working video

This commit is contained in:
2026-03-12 16:33:57 -05:00
parent 75723ed133
commit 1e5f80739c
7 changed files with 183 additions and 7 deletions
+4 -4
View File
@@ -579,7 +579,7 @@ const mapRecordToTask = (r: any): Task => {
export const uploadTaskAttachment = async (taskId: string, file: File): Promise<string> => {
try {
const formData = new FormData();
formData.append('attachments', file);
formData.append('attachments+', file);
const record = await pb.collection(TASGRID_COLLECTION).update(taskId, formData);
@@ -593,7 +593,7 @@ export const uploadTaskAttachment = async (taskId: string, file: File): Promise<
throw new Error("File uploaded but no attachment returned");
} catch (err: any) {
console.error("Error uploading attachment:", err);
console.error("Error uploading attachment. Validation details:", JSON.stringify(err.data, null, 2));
toast.error("Failed to upload image.");
throw err;
}
@@ -602,7 +602,7 @@ export const uploadTaskAttachment = async (taskId: string, file: File): Promise<
export const uploadNoteAttachment = async (noteId: string, file: File): Promise<string> => {
try {
const formData = new FormData();
formData.append('attachments', file);
formData.append('attachments+', file);
const record = await pb.collection(NOTES_COLLECTION).update(noteId, formData);
@@ -613,7 +613,7 @@ export const uploadNoteAttachment = async (noteId: string, file: File): Promise<
throw new Error("File uploaded but no attachment returned");
} catch (err: any) {
console.error("Error uploading note attachment:", err);
console.error("Error uploading note attachment. Validation details:", JSON.stringify(err.data, null, 2));
toast.error("Failed to upload image to note.");
throw err;
}