fix: errors

This commit is contained in:
David Nguyen
2025-02-06 01:57:23 +11:00
parent 7effe66387
commit 738201eb55
43 changed files with 159 additions and 1068 deletions

View File

@ -47,6 +47,7 @@ export const TemplateCreateDialog = ({ templateRootPath }: TemplateCreateDialogP
setIsUploadingFile(true);
try {
// Todo
// const { type, data } = await putPdfFile(file);
const formData = new FormData();
@ -56,7 +57,7 @@ export const TemplateCreateDialog = ({ templateRootPath }: TemplateCreateDialogP
method: 'POST',
body: formData,
})
.then((res) => res.json())
.then(async (res) => await res.json())
.catch((e) => {
console.error('Upload failed:', e);
throw new AppError('UPLOAD_FAILED');

View File

@ -426,7 +426,7 @@ export const TemplateDirectLinkDialog = ({
await toggleTemplateDirectLink({
templateId: template.id,
enabled: isEnabled,
}).catch((e) => null);
}).catch(() => null);
onOpenChange(false);
}}

View File

@ -159,7 +159,7 @@ export function TemplateUseDialog({
method: 'POST',
body: formData,
})
.then((res) => res.json())
.then(async (res) => await res.json())
.catch((e) => {
console.error('Upload failed:', e);
throw new AppError('UPLOAD_FAILED');