Browse Source

fix(gui-v2): check if arr exists before mapping

pull/3300/head
braks 2 years ago
parent
commit
def691b5d4
  1. 6
      packages/nc-gui-v2/composables/useSharedFormViewStore.ts

6
packages/nc-gui-v2/composables/useSharedFormViewStore.ts

@ -134,9 +134,9 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
/** find attachments in form data */ /** find attachments in form data */
for (const col of metas.value?.[sharedView.value?.fk_model_id as string]?.columns) { for (const col of metas.value?.[sharedView.value?.fk_model_id as string]?.columns) {
if (col.uidt === UITypes.Attachment) { if (col.uidt === UITypes.Attachment) {
console.log(data[col.title!]) if (data[col.title]) {
attachment[`_${col.title}`] = data[col.title].map((item: { file: File }) => item.file)
attachment[`_${col.title}`] = data[col.title].map((item: { file: File }) => item.file) }
} }
} }

Loading…
Cancel
Save