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