|
|
@ -1,6 +1,15 @@ |
|
|
|
import {ViewTypes} from 'nocodb-sdk' |
|
|
|
import {ViewTypes} from 'nocodb-sdk' |
|
|
|
import axios from 'axios' |
|
|
|
import axios from 'axios' |
|
|
|
import type { Api, ColumnType, FormColumnType, FormType, GalleryType, PaginatedType, TableType, ViewType } from 'nocodb-sdk' |
|
|
|
import type { |
|
|
|
|
|
|
|
Api, |
|
|
|
|
|
|
|
ColumnType, |
|
|
|
|
|
|
|
FormColumnType, |
|
|
|
|
|
|
|
FormType, |
|
|
|
|
|
|
|
GalleryType, |
|
|
|
|
|
|
|
PaginatedType, |
|
|
|
|
|
|
|
TableType, |
|
|
|
|
|
|
|
ViewType |
|
|
|
|
|
|
|
} from 'nocodb-sdk' |
|
|
|
import type {ComputedRef, Ref} from 'vue' |
|
|
|
import type {ComputedRef, Ref} from 'vue' |
|
|
|
import {NavigateDir} from '#imports' |
|
|
|
import {NavigateDir} from '#imports' |
|
|
|
|
|
|
|
|
|
|
@ -143,6 +152,7 @@ export function useViewData( |
|
|
|
|
|
|
|
|
|
|
|
if (!ids?.length || ids?.some((id) => !id)) return |
|
|
|
if (!ids?.length || ids?.some((id) => !id)) return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
aggCommentCount.value = await $api.utils.commentCount({ |
|
|
|
aggCommentCount.value = await $api.utils.commentCount({ |
|
|
|
ids, |
|
|
|
ids, |
|
|
|
fk_model_id: metaId.value as string, |
|
|
|
fk_model_id: metaId.value as string, |
|
|
@ -152,6 +162,9 @@ export function useViewData( |
|
|
|
const id = extractPkFromRow(row.row, meta.value?.columns as ColumnType[]) |
|
|
|
const id = extractPkFromRow(row.row, meta.value?.columns as ColumnType[]) |
|
|
|
row.rowMeta.commentCount = +(aggCommentCount.value?.find((c: Record<string, any>) => c.row_id === id)?.count || 0) |
|
|
|
row.rowMeta.commentCount = +(aggCommentCount.value?.find((c: Record<string, any>) => c.row_id === id)?.count || 0) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
console.error(e) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const controller = ref() |
|
|
|
const controller = ref() |
|
|
|