Browse Source

fix: avoid loading view filters to webhook condition

pull/7377/head
mertmit 12 months ago
parent
commit
56039cb0f7
  1. 4
      packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
  2. 8
      packages/nc-gui/composables/useViewFilters.ts

4
packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue

@ -188,7 +188,7 @@ watch(
() => activeView.value?.id,
(n, o) => {
// if nested no need to reload since it will get reloaded from parent
if (!nested.value && n !== o && (hookId?.value || !webHook.value)) loadFilters(hookId?.value)
if (!nested.value && n !== o && (hookId?.value || !webHook.value)) loadFilters(hookId?.value, webHook.value)
},
)
@ -325,7 +325,7 @@ const showFilterInput = (filter: Filter) => {
}
onMounted(() => {
loadFilters(hookId?.value)
loadFilters(hookId?.value, webHook.value)
})
onMounted(async () => {

8
packages/nc-gui/composables/useViewFilters.ts

@ -190,7 +190,7 @@ export function useViewFilters(
}
}
const loadFilters = async (hookId?: string) => {
const loadFilters = async (hookId?: string, isWebhook = false) => {
if (!view.value?.id) return
if (nestedMode.value) {
@ -199,11 +199,11 @@ export function useViewFilters(
}
try {
if (hookId) {
if (isWebhook || hookId) {
if (parentId) {
filters.value = (await $api.dbTableFilter.childrenRead(parentId)).list as Filter[]
} else {
filters.value = (await $api.dbTableWebhookFilter.read(hookId!)).list as Filter[]
} else if (hookId) {
filters.value = (await $api.dbTableWebhookFilter.read(hookId)).list as Filter[]
}
} else {
if (parentId) {

Loading…
Cancel
Save