working video
This commit is contained in:
+4
-4
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user