NTP-45438 | Reaalocation payload changes (#1395)

This commit is contained in:
Ashish Deo
2025-03-10 15:24:23 +05:30
committed by GitHub
parent b39ffeb3b2
commit 294f8117d0
3 changed files with 16 additions and 6 deletions

View File

@@ -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));
});
};

View File

@@ -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: '' }));

View File

@@ -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 {