From f9dbfc7a55db360f541bc777ff9ab3bc28704a0a Mon Sep 17 00:00:00 2001 From: nidhigarg Date: Tue, 8 Aug 2023 11:11:39 +0530 Subject: [PATCH] fix(ssi credntial): fix filters --- .../AdminCredential/AdminCredentialElements.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/pages/AdminCredential/AdminCredentialElements.tsx b/src/components/pages/AdminCredential/AdminCredentialElements.tsx index 533dd2d0c..3c1eeb005 100644 --- a/src/components/pages/AdminCredential/AdminCredentialElements.tsx +++ b/src/components/pages/AdminCredential/AdminCredentialElements.tsx @@ -69,22 +69,21 @@ export default function AdminCredentialElements() { const viewValue = e.currentTarget.value if (viewValue === FilterType.OPEN) setFilterValueAPI(SubscriptionStatus.PENDING) - if (viewValue === FilterType.CONFIRMED) + else if (viewValue === FilterType.CONFIRMED) setFilterValueAPI(SubscriptionStatus.ACTIVE) - if (viewValue === FilterType.DECLINED) + else if (viewValue === FilterType.DECLINED) setFilterValueAPI(SubscriptionStatus.INACTIVE) + else setFilterValueAPI('') setFilterStatus(viewValue) setGroup(viewValue) setRefresh(Date.now()) } useEffect(() => { - if (onValidate(searchExpr)) { - setFetchHookArgs({ - filterType: filterValueAPI, - expr: searchExpr, - }) - } + setFetchHookArgs({ + filterType: filterValueAPI, + expr: searchExpr, + }) }, [filterStatus, searchExpr]) const onValidate = (expr: string) => {