From 6f9f79d84143215bc37ad23ed1415faa3f0286ef Mon Sep 17 00:00:00 2001 From: Akshata Katwal Date: Sat, 9 Nov 2024 17:38:10 +0530 Subject: [PATCH 1/2] update pr --- src/pages/observation/[observationId]/index.tsx | 2 +- src/utils/app.constant.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/observation/[observationId]/index.tsx b/src/pages/observation/[observationId]/index.tsx index aea76ed5..49881f26 100644 --- a/src/pages/observation/[observationId]/index.tsx +++ b/src/pages/observation/[observationId]/index.tsx @@ -444,7 +444,7 @@ setEntityData(result) entityType !== ObservationEntityType.CENTER ? onStartObservation(item?._id) diff --git a/src/utils/app.constant.ts b/src/utils/app.constant.ts index 26624f8b..d78cbe58 100644 --- a/src/utils/app.constant.ts +++ b/src/utils/app.constant.ts @@ -90,7 +90,7 @@ export enum ObservationStatus { DRAFT = 'draft', COMPLETED = 'completed', NOT_STARTED = 'notstarted', - Started="started" + STARTED="started" } export enum CenterType { From 4a7ba58cfb020628c1ca9840360c7f8eb0e51ea8 Mon Sep 17 00:00:00 2001 From: Akshata Katwal Date: Sun, 10 Nov 2024 12:59:49 +0530 Subject: [PATCH 2/2] Issue feat:call fetch entity api when we add new unmatched entities --- src/pages/observation/[observationId]/index.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pages/observation/[observationId]/index.tsx b/src/pages/observation/[observationId]/index.tsx index 49881f26..0939ff0d 100644 --- a/src/pages/observation/[observationId]/index.tsx +++ b/src/pages/observation/[observationId]/index.tsx @@ -271,9 +271,22 @@ setEntityData(result) const observationId = Id; if (entity === ObservationEntityType.CENTER && unmatchedCohortIds.length !== 0) { await addEntities({ data, observationId }); + const urlPath = window.location.pathname; + + const solutionId = urlPath.split('/observation/')[1]; + + const response = await fetchEntities({ solutionId }); + setFetchEntityResponse(response?.result?.entities) } else if (unmatchedUserIds.length !== 0) { await addEntities({ data, observationId }); + const urlPath = window.location.pathname; + + const solutionId = urlPath.split('/observation/')[1]; + + const response = await fetchEntities({ solutionId }); + setFetchEntityResponse(response?.result?.entities) } + } };