|
|
|
@ -161,6 +161,7 @@ export function useViewFilters(
|
|
|
|
|
|
|
|
|
|
const placeholderFilter = (): Filter => { |
|
|
|
|
return { |
|
|
|
|
// TODO: fix type
|
|
|
|
|
comparison_op: comparisonOpList(options.value?.[0].uidt as UITypes).filter((compOp) => |
|
|
|
|
isComparisonOpAllowed({ fk_column_id: options.value?.[0].id }, compOp), |
|
|
|
|
)?.[0].value, |
|
|
|
@ -180,16 +181,15 @@ export function useViewFilters(
|
|
|
|
|
try { |
|
|
|
|
if (hookId) { |
|
|
|
|
if (parentId) { |
|
|
|
|
filters.value = await $api.dbTableFilter.childrenRead(parentId) |
|
|
|
|
filters.value = (await $api.dbTableFilter.childrenRead(parentId)).list as Filter[] |
|
|
|
|
} else { |
|
|
|
|
// todo: return type is incorrect
|
|
|
|
|
filters.value = (await $api.dbTableWebhookFilter.read(hookId!)) as unknown as Filter[] |
|
|
|
|
filters.value = (await $api.dbTableWebhookFilter.read(hookId!)).list as Filter[] |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (parentId) { |
|
|
|
|
filters.value = await $api.dbTableFilter.childrenRead(parentId) |
|
|
|
|
filters.value = (await $api.dbTableFilter.childrenRead(parentId)).list as Filter[] |
|
|
|
|
} else { |
|
|
|
|
filters.value = await $api.dbTableFilter.read(view.value!.id!) |
|
|
|
|
filters.value = (await $api.dbTableFilter.read(view.value!.id!)).list as Filter[] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (e: any) { |
|
|
|
|