Browse Source

fix(gui-v2): add isUIAllowed('sortSync') in useViewSorts

pull/3087/head
Wing-Kam Wong 2 years ago
parent
commit
f4e368a158
  1. 5
      packages/nc-gui-v2/composables/useViewSorts.ts

5
packages/nc-gui-v2/composables/useViewSorts.ts

@ -10,13 +10,15 @@ export function useViewSorts(
const { $api } = useNuxtApp()
const { isUIAllowed } = useUIPermission()
const loadSorts = async () => {
if (!view?.value) return
sorts.value = ((await $api.dbTableSort.list(view?.value?.id as string)) as any)?.sorts?.list
}
const saveOrUpdate = async (sort: SortType, i: number) => {
if (!sorts?.value) return
if (!isUIAllowed('sortSync') || !sorts?.value) return
if (sort.id) {
await $api.dbTableSort.update(sort.id, sort)
} else {
@ -32,6 +34,7 @@ export function useViewSorts(
const deleteSort = async (sort: SortType, i: number) => {
// if (!this.shared && sort.id && this._isUIAllowed('sortSync')) {
if (!isUIAllowed('sortSync')) return
if (sort.id) {
await $api.dbTableSort.delete(sort.id)
}

Loading…
Cancel
Save