Browse Source

fix(nc-gui): oldAttachment not iterable

pull/4959/head
Wing-Kam Wong 2 years ago
parent
commit
4f4d876bbd
  1. 2
      packages/nc-gui/composables/useKanbanViewStore.ts
  2. 2
      packages/nc-gui/composables/useViewData.ts

2
packages/nc-gui/composables/useKanbanViewStore.ts

@ -198,6 +198,8 @@ const [useProvideKanbanViewStore, useKanbanViewStore] = useInjectionState(
// See /packages/nocodb/src/lib/version-upgrader/ncAttachmentUpgrader.ts for the details
for (const record of data.value.list) {
for (const attachmentColumn of attachmentColumns.value) {
// attachment column can be hidden
if (!record[attachmentColumn!]) continue
const oldAttachment = JSON.parse(record[attachmentColumn!])
const newAttachment = []
for (const attachmentObj of oldAttachment) {

2
packages/nc-gui/composables/useViewData.ts

@ -239,6 +239,8 @@ export function useViewData(
const records = []
for (const record of response.list) {
for (const attachmentColumn of attachmentColumns.value) {
// attachment column can be hidden
if (!record[attachmentColumn!]) continue
const oldAttachment =
typeof record[attachmentColumn!] === 'string' ? JSON.parse(record[attachmentColumn!]) : record[attachmentColumn!]
const newAttachment = []

Loading…
Cancel
Save