From 430b040d3b61dc276754ad014a5e6598b43e8135 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Tue, 17 Jan 2023 11:59:50 +0800 Subject: [PATCH] fix(nc-gui): missing attachment table name --- packages/nc-gui/components/cell/attachment/utils.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui/components/cell/attachment/utils.ts b/packages/nc-gui/components/cell/attachment/utils.ts index ed732eb1af..c4770a88cc 100644 --- a/packages/nc-gui/components/cell/attachment/utils.ts +++ b/packages/nc-gui/components/cell/attachment/utils.ts @@ -118,13 +118,12 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState( for (const file of selectedFiles) { // verify mime type - const meta = typeof column.value?.meta === 'string' ? JSON.parse(column.value.meta) : column.value?.meta - if (meta.unsupportedAttachmentMimeTypes.includes(file.type)) { + const attachmentMeta = typeof column.value?.meta === 'string' ? JSON.parse(column.value.meta) : column.value?.meta + if (attachmentMeta.unsupportedAttachmentMimeTypes.includes(file.type)) { message.error(`${file.name} has the mime type ${file.type} which is not allowed in this column.`) continue } - // file = await renameFile(file) try { const data = await api.storage.upload( { @@ -135,7 +134,6 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState( json: '{}', }, ) - newAttachments.push(...data) } catch (e: any) { message.error(e.message || t('msg.error.internalError'))