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 {