Browse Source

Merge pull request #3324 from nocodb/fix/gui-v2-formula-cell-update

fix(gui-v2): trigger reload in updateOrSaveRow
pull/3331/head
Raju Udava 2 years ago committed by GitHub
parent
commit
ae51d53b4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      packages/nc-gui-v2/composables/useViewData.ts

12
packages/nc-gui-v2/composables/useViewData.ts

@ -2,7 +2,15 @@ import type { Api, ColumnType, FormType, GalleryType, PaginatedType, TableType,
import type { ComputedRef, Ref } from 'vue' import type { ComputedRef, Ref } from 'vue'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { useNuxtApp } from '#app' import { useNuxtApp } from '#app'
import { IsPublicInj, NOCO, extractPkFromRow, extractSdkResponseErrorMsg, useProject, useUIPermission } from '#imports' import {
IsPublicInj,
NOCO,
ReloadViewDataHookInj,
extractPkFromRow,
extractSdkResponseErrorMsg,
useProject,
useUIPermission,
} from '#imports'
const formatData = (list: Record<string, any>[]) => const formatData = (list: Record<string, any>[]) =>
list.map((row) => ({ list.map((row) => ({
@ -39,6 +47,7 @@ export function useViewData(
const formattedData = ref<Row[]>([]) const formattedData = ref<Row[]>([])
const isPublic = inject(IsPublicInj, ref(false)) const isPublic = inject(IsPublicInj, ref(false))
const reloadHook = inject(ReloadViewDataHookInj)!
const { project, isSharedBase } = useProject() const { project, isSharedBase } = useProject()
const { fetchSharedViewData, paginationData: sharedPaginationData } = useSharedView() const { fetchSharedViewData, paginationData: sharedPaginationData } = useSharedView()
const { $api } = useNuxtApp() const { $api } = useNuxtApp()
@ -205,6 +214,7 @@ export function useViewData(
} else { } else {
await updateRowProperty(row.row, property) await updateRowProperty(row.row, property)
} }
reloadHook.trigger()
} }
const changePage = async (page: number) => { const changePage = async (page: number) => {
paginationData.value.page = page paginationData.value.page = page

Loading…
Cancel
Save