Browse Source

Merge pull request #7377 from nocodb/nc-fix/hook-filter

fix: avoid loading view filters to webhook condition
pull/7394/head
Raju Udava 10 months ago committed by GitHub
parent
commit
cf138af5e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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