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. 15
      packages/nc-gui/composables/useKanbanViewData.ts

15
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, {
(
await api.dbViewRow.list('noco', project.value.id!, meta!.value.id!, viewMeta!.value.id, {
...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }), ...(isUIAllowed('sortSync') ? {} : { sortArrJson: JSON.stringify(sorts.value) }),
...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }), ...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }),
where, where,
}) })
).list,
) formattedData.value[option.title] = formatData(response.list)
countByStack.value[option.title] = countByStack.value[option.title] = response.pageInfo.totalRows || 0
(
await api.dbViewRow.count('noco', project.value.id!, meta!.value.id!, viewMeta!.value.id, {
where,
})
).count || 0
}), }),
) )
} }

Loading…
Cancel
Save