From 9c388d8e500a8672d95f0366f33d5bbb0e887389 Mon Sep 17 00:00:00 2001 From: Dakshesh Jain <65905942+dakshesh14@users.noreply.github.com> Date: Tue, 21 Mar 2023 17:11:04 +0530 Subject: [PATCH] refactor: setting filters as null if value is an empty array (#483) * refractor: added params to fetch key * feat: create views directly from views list page fix: selected filter not showing up in multi-level dropdown, refactor: arranged imports * refactor: setting filters as null if value is an empty array --- apps/app/contexts/issue-view.context.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/app/contexts/issue-view.context.tsx b/apps/app/contexts/issue-view.context.tsx index 1a897bc22..0d96512fd 100644 --- a/apps/app/contexts/issue-view.context.tsx +++ b/apps/app/contexts/issue-view.context.tsx @@ -336,6 +336,12 @@ export const IssueViewContextProvider: React.FC<{ children: React.ReactNode }> = const setFilters = useCallback( (property: Partial) => { + Object.keys(property).forEach((key) => { + if (property[key as keyof typeof property]?.length === 0) { + property[key as keyof typeof property] = null; + } + }); + dispatch({ type: "SET_FILTERS", payload: {