Browse Source

refactor(nc-gui): use totalRows from list instead of calling extra APIs

pull/3818/head
Wing-Kam Wong 2 years ago
parent
commit
77ee4c0b70
  1. 23
      packages/nc-gui/composables/useKanbanViewData.ts

23
packages/nc-gui/composables/useKanbanViewData.ts

@ -56,21 +56,14 @@ export function useKanbanViewData(
const where = const where =
option.title === 'Uncategorized' ? `(${groupingField.value},is,null)` : `(${groupingField.value},eq,${option.title})` option.title === 'Uncategorized' ? `(${groupingField.value},is,null)` : `(${groupingField.value},eq,${option.title})`
formattedData.value[option.title] = formatData( const response = await api.dbViewRow.list('noco', project.value.id!, meta!.value.id!, viewMeta!.value.id, {
( ...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }),
await api.dbViewRow.list('noco', project.value.id!, meta!.value.id!, viewMeta!.value.id, { ...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }),
...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }), where,
...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }), })
where,
}) formattedData.value[option.title] = formatData(response.list)
).list, countByStack.value[option.title] = response.pageInfo.totalRows || 0
)
countByStack.value[option.title] =
(
await api.dbViewRow.count('noco', project.value.id!, meta!.value.id!, viewMeta!.value.id, {
where,
})
).count || 0
}), }),
) )
} }

Loading…
Cancel
Save