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();