Browse Source

fix: unhandled exception - show error message if list api failed

pull/7392/head
Pranav C 12 months ago
parent
commit
4ee587757d
  1. 14
      packages/nc-gui/composables/useViewData.ts

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

@ -211,7 +211,8 @@ export function useViewData(
if (error.code === 'ERR_CANCELED') { if (error.code === 'ERR_CANCELED') {
return return
} }
throw error console.error(error)
return message.error(await extractSdkResponseErrorMsg(error))
} }
formattedData.value = formatData(response.list) formattedData.value = formatData(response.list)
paginationData.value = response.pageInfo paginationData.value = response.pageInfo
@ -238,10 +239,13 @@ export function useViewData(
async function changePage(page: number) { async function changePage(page: number) {
paginationData.value.page = page paginationData.value.page = page
await loadData({ await loadData(
offset: (page - 1) * (paginationData.value.pageSize || appInfoDefaultLimit), {
where: where?.value, offset: (page - 1) * (paginationData.value.pageSize || appInfoDefaultLimit),
} as any) where: where?.value,
} as any,
true,
)
} }
const { const {

Loading…
Cancel
Save