From 294f8117d0c4b9e197d6553f62171ca4e3c8c7ec Mon Sep 17 00:00:00 2001 From: Ashish Deo Date: Mon, 10 Mar 2025 15:24:23 +0530 Subject: [PATCH] NTP-45438 | Reaalocation payload changes (#1395) --- src/pages/Reallocation/actions/reallocationActions.ts | 4 ++-- src/pages/Reallocation/components/Reallocation.tsx | 9 +++++++-- .../Reallocation/constants/reallocationInterfaces.ts | 9 +++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/pages/Reallocation/actions/reallocationActions.ts b/src/pages/Reallocation/actions/reallocationActions.ts index 74dd0d62..7c336eed 100644 --- a/src/pages/Reallocation/actions/reallocationActions.ts +++ b/src/pages/Reallocation/actions/reallocationActions.ts @@ -144,10 +144,10 @@ export const getReallocationCaseTypes = (referenceId: string) => (dispatch: Disp axiosInstance .get(url, { params: { - allocatingFromAgentReferenceId: referenceId + sourceAgentReferenceId: referenceId } }) .then(res => { - dispatch(setReallocationCaseTypes(res?.data?.eligibleCaseTypes)); + dispatch(setReallocationCaseTypes(res?.data?.eligibleReAllocationSubType)); }); }; diff --git a/src/pages/Reallocation/components/Reallocation.tsx b/src/pages/Reallocation/components/Reallocation.tsx index 5d876e66..df7caf6f 100644 --- a/src/pages/Reallocation/components/Reallocation.tsx +++ b/src/pages/Reallocation/components/Reallocation.tsx @@ -55,8 +55,13 @@ const Reallocation = () => { const handleReallocation = (requestParams: IReallocationFormValues) => { const payload: IReallocationSubmitPayload = { - type: 'TELE_RE_ALLOCATION', - requestParams + reAllocationType: 'TELE_RE_ALLOCATION', + reAllocationSubType: requestParams.subReallocationType, + reAllocationReason: requestParams.reasonType, + reasonDescription: requestParams.reason, + sourceAgentReferenceId: requestParams.fromAgentReferenceId, + agentCohort: requestParams.toType, + destinationAgentReferenceIds: requestParams.toAgentReferenceIds }; dispatch(submitReallocation(payload, resetForm)); dispatch(getReporteesWithAllocation({ ...defaultPageOptionsAgents, email: '' })); diff --git a/src/pages/Reallocation/constants/reallocationInterfaces.ts b/src/pages/Reallocation/constants/reallocationInterfaces.ts index 2dd7ddac..98fda811 100644 --- a/src/pages/Reallocation/constants/reallocationInterfaces.ts +++ b/src/pages/Reallocation/constants/reallocationInterfaces.ts @@ -112,8 +112,13 @@ export interface IReallocationFormValues { } export interface IReallocationSubmitPayload { - type: string; - requestParams: IReallocationFormValues; + reAllocationType: string; + reAllocationSubType: string; + reAllocationReason: string; + reasonDescription: string; + sourceAgentReferenceId: string; + agentCohort: string; + destinationAgentReferenceIds: string[]; } export interface IReallocationForm {