diff --git a/packages/nc-gui-v2/composables/useViewData.ts b/packages/nc-gui-v2/composables/useViewData.ts index a49fdd4b25..16b689563d 100644 --- a/packages/nc-gui-v2/composables/useViewData.ts +++ b/packages/nc-gui-v2/composables/useViewData.ts @@ -18,6 +18,7 @@ export interface Row { oldRow: Record rowMeta: { new?: boolean + selected?: boolean commentCount?: number } } @@ -33,7 +34,7 @@ export function useViewData( const formattedData = ref([]) const paginationData = ref({ page: 1, pageSize: 25 }) - const aggCommentCount = ref[]>([]) + const aggCommentCount = ref<{ row_id: string; count: number }[]>([]) const galleryData = ref(undefined) const formColumnData = ref(undefined) const formViewData = ref(undefined) @@ -43,10 +44,10 @@ export function useViewData( const selectedAllRecords = computed({ get() { - return formattedData.value.every((row: Record) => row.rowMeta.selected) + return formattedData.value.every((row: Row) => row.rowMeta.selected) }, - set(selected) { - formattedData.value.forEach((row: Record) => (row.rowMeta.selected = selected)) + set(selected: boolean) { + formattedData.value.forEach((row: Row) => (row.rowMeta.selected = selected)) }, }) @@ -208,7 +209,7 @@ export function useViewData( const deleteRowById = async (id: string) => { if (!id) { - throw new Error("Delete not allowed for table which doesn't have primary Key") + throw new Error('Delete not allowed for table which doesn\'t have primary Key') } const res: any = await $api.dbViewRow.delete(