From f8ec40dbfba769d1b0767f56434b245148fa4906 Mon Sep 17 00:00:00 2001 From: Kanav Arora Date: Thu, 4 Apr 2024 19:03:17 +0530 Subject: [PATCH] Fix: File Upload (#4806) File upload issue fixed. There was a type mismatch and isDate was returning false --- .../modules/activities/files/hooks/useUploadAttachmentFile.tsx | 1 + .../twenty-front/src/modules/attachments/types/Attachment.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/activities/files/hooks/useUploadAttachmentFile.tsx b/packages/twenty-front/src/modules/activities/files/hooks/useUploadAttachmentFile.tsx index b872acab5..2d94d15d8 100644 --- a/packages/twenty-front/src/modules/activities/files/hooks/useUploadAttachmentFile.tsx +++ b/packages/twenty-front/src/modules/activities/files/hooks/useUploadAttachmentFile.tsx @@ -45,6 +45,7 @@ export const useUploadAttachmentFile = () => { fullPath: attachmentUrl, type: getFileType(file.name), [targetableObjectFieldIdName]: targetableObject.id, + createdAt: new Date().toISOString(), } as Partial; await createOneAttachment(attachmentToCreate); diff --git a/packages/twenty-front/src/modules/attachments/types/Attachment.ts b/packages/twenty-front/src/modules/attachments/types/Attachment.ts index 657ce6b48..563e516d2 100644 --- a/packages/twenty-front/src/modules/attachments/types/Attachment.ts +++ b/packages/twenty-front/src/modules/attachments/types/Attachment.ts @@ -1,6 +1,6 @@ export type Attachment = { id: string; - createdAt: Date; + createdAt: string; updatedAt: Date; deletedAt: Date | null; };