From fdc6e0fd8008b04501ff6d1ffed46e5b4899a265 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 10 Mar 2023 12:18:19 +0800 Subject: [PATCH] refactor(nocodb): filter types --- packages/nc-gui/composables/useViewFilters.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/nc-gui/composables/useViewFilters.ts b/packages/nc-gui/composables/useViewFilters.ts index d3fc0da851..2abdd65d31 100644 --- a/packages/nc-gui/composables/useViewFilters.ts +++ b/packages/nc-gui/composables/useViewFilters.ts @@ -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) {