|
|
@ -36,9 +36,9 @@ export function useGridViewColumnWidth(view: Ref<(GridType & { id?: string }) | |
|
|
|
{ deep: true, immediate: true }, |
|
|
|
{ deep: true, immediate: true }, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const loadGridViewColumns = async (cols?: GridColumnType[] | undefined) => { |
|
|
|
const loadGridViewColumns = async () => { |
|
|
|
if (!view.value?.id && !cols) return |
|
|
|
if (!view.value?.id && !isPublic.value) return |
|
|
|
const colsData: GridColumnType[] = cols ?? (await $api.dbView.gridColumnsList(view.value.id)) |
|
|
|
const colsData: GridColumnType[] = isPublic.value ? columns.value : await $api.dbView.gridColumnsList(view.value.id) |
|
|
|
gridViewCols.value = colsData.reduce<Record<string, GridColumnType>>( |
|
|
|
gridViewCols.value = colsData.reduce<Record<string, GridColumnType>>( |
|
|
|
(o, col) => ({ |
|
|
|
(o, col) => ({ |
|
|
|
...o, |
|
|
|
...o, |
|
|
|