From e5c2cadbdcf68cdbe51e6a6673d437f6eb748d88 Mon Sep 17 00:00:00 2001 From: Manojava Koushik <111366021+manojava-gk@users.noreply.github.com> Date: Wed, 16 Oct 2024 19:56:10 +0530 Subject: [PATCH] fix(company subscription): fixed duplicate api records on load (#1206) --- CHANGELOG.md | 5 ++--- src/components/pages/CompanySubscriptions/index.tsx | 11 +++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61a75f33f..ca6d8dc50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,11 +53,10 @@ - fixed customer link selection and fixed resetting values [#1119](https://github.com/eclipse-tractusx/portal-frontend/pull/1119) - **Technical User Management** - fixed error message scenario post technical user deletion action -- **OSP Managament** - - fixed hardcoded OSP callback url [#1201](https://github.com/eclipse-tractusx/portal-frontend/pull/1201) - - fixed error message scenario post technical user deletion action [#1164](https://github.com/eclipse-tractusx/portal-frontend/pull/1164) - **Company Subscriptions** - fixed incorrect data display in service company subscriptions [#1191](https://github.com/eclipse-tractusx/portal-frontend/pull/1191) + - fixed error message scenario post technical user deletion action [#1164](https://github.com/eclipse-tractusx/portal-frontend/pull/1164) + - fixed duplicate api records on load [#1206] (https://github.com/eclipse-tractusx/portal-frontend/pull/1206) ## 2.3.0-alpha.1 diff --git a/src/components/pages/CompanySubscriptions/index.tsx b/src/components/pages/CompanySubscriptions/index.tsx index c121189c4..9f035a2ec 100644 --- a/src/components/pages/CompanySubscriptions/index.tsx +++ b/src/components/pages/CompanySubscriptions/index.tsx @@ -86,6 +86,7 @@ export default function CompanySubscriptions() { _e: SyntheticEvent, value: number ) => { + setRefresh(0) setCurrentActive(value) } @@ -113,10 +114,12 @@ export default function CompanySubscriptions() { ] useEffect(() => { - setFetchHookArgs({ - statusId: filterStatus, - expr: searchExpr, - }) + if (refresh !== 0) { + setFetchHookArgs({ + statusId: filterStatus, + expr: searchExpr, + }) + } }, [filterStatus, searchExpr]) const onValidate = (expr: string) => {