From 7abad139f886d0205a2b9ac7348c75da9beb9ea1 Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Thu, 11 Aug 2022 17:59:17 -0400 Subject: [PATCH] fix: uploadFile when folder is undefined In uploadFile, folder can be undefined when uploading to the parent folder. --- packages/client/src/scripts/upload.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/scripts/upload.ts b/packages/client/src/scripts/upload.ts index 1bbcbc520..a2a085faa 100644 --- a/packages/client/src/scripts/upload.ts +++ b/packages/client/src/scripts/upload.ts @@ -29,11 +29,11 @@ const mimeTypeMap = { export function uploadFile( file: File, - folder?: any, + folder?: string | Record, name?: string, keepOriginal: boolean = defaultStore.state.keepOriginalUploading, ): Promise { - const folderId = typeof folder === 'string' ? folder : folder.id; + const folderId = typeof folder === 'string' ? folder : folder?.id; return new Promise((resolve, reject) => { const id = Math.random().toString();