Browse Source

fix: avoid loading view filters to webhook condition

pull/7377/head
mertmit 10 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, () => activeView.value?.id,
(n, o) => { (n, o) => {
// if nested no need to reload since it will get reloaded from parent // 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(() => { onMounted(() => {
loadFilters(hookId?.value) loadFilters(hookId?.value, webHook.value)
}) })
onMounted(async () => { 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 (!view.value?.id) return
if (nestedMode.value) { if (nestedMode.value) {
@ -199,11 +199,11 @@ export function useViewFilters(
} }
try { try {
if (hookId) { if (isWebhook || hookId) {
if (parentId) { if (parentId) {
filters.value = (await $api.dbTableFilter.childrenRead(parentId)).list as Filter[] filters.value = (await $api.dbTableFilter.childrenRead(parentId)).list as Filter[]
} else { } else if (hookId) {
filters.value = (await $api.dbTableWebhookFilter.read(hookId!)).list as Filter[] filters.value = (await $api.dbTableWebhookFilter.read(hookId)).list as Filter[]
} }
} else { } else {
if (parentId) { if (parentId) {

Loading…
Cancel
Save