Browse Source

fix: avoid reloading data for hook filter

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/5624/head
mertmit 2 years ago
parent
commit
e6193c57f9
  1. 2
      packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
  2. 2
      packages/nc-gui/components/webhook/Editor.vue
  3. 9
      packages/nc-gui/composables/useViewFilters.ts

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

@ -64,6 +64,7 @@ const {
() => reloadDataHook.trigger(showLoading),
modelValue || nestedFilters.value,
!modelValue,
webHook,
)
const localNestedFilters = ref()
@ -249,6 +250,7 @@ defineExpose({
:parent-id="filter.id"
nested
:auto-save="autoSave"
:web-hook="webHook"
/>
</div>
</template>

2
packages/nc-gui/components/webhook/Editor.vue

@ -710,7 +710,7 @@ onMounted(async () => {
:auto-save="false"
:show-loading="false"
:hook-id="hook.id"
web-hook
:web-hook="true"
/>
</a-card>
</a-col>

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

@ -29,6 +29,7 @@ export function useViewFilters(
reloadData?: () => void,
_currentFilters?: Filter[],
isNestedRoot?: boolean,
isWebhook?: boolean,
) {
let currentFilters = $ref(_currentFilters)
@ -238,7 +239,7 @@ export function useViewFilters(
}
}
reloadData?.()
if (!isWebhook) reloadData?.()
} catch (e: any) {
console.log(e)
message.error(await extractSdkResponseErrorMsg(e))
@ -308,7 +309,7 @@ export function useViewFilters(
lastFilters.value = clone(filters.value)
reloadData?.()
if (!isWebhook) reloadData?.()
}
const deleteFilter = async (filter: Filter, i: number, undo = false) => {
@ -335,7 +336,7 @@ export function useViewFilters(
if (nestedMode.value) {
filters.value.splice(i, 1)
filters.value = [...filters.value]
reloadData?.()
if (!isWebhook) reloadData?.()
} else {
if (filter.id) {
// if auto-apply disabled mark it as disabled
@ -346,7 +347,7 @@ export function useViewFilters(
} else {
try {
await $api.dbTableFilter.delete(filter.id)
reloadData?.()
if (!isWebhook) reloadData?.()
filters.value.splice(i, 1)
} catch (e: any) {
console.log(e)

Loading…
Cancel
Save