40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { patch, post } from "../NetworkService";
|
|
import { APPLICATION_ID_PATH, FILL_APPLICATION_PATH } from "../NetworkConstant";
|
|
import { MemberDetailsRootObject } from "../../App/common/interface/MemberDetailsResponse";
|
|
|
|
export const getApplicationId = (
|
|
applicationType: string = "DEMO_11",
|
|
applicantType: string = "CUSTOMER"
|
|
) => {
|
|
const path = APPLICATION_ID_PATH;
|
|
const requestBody = JSON.stringify({
|
|
applicantType: applicantType,
|
|
applicationType: applicationType,
|
|
isScreenCtaRequired: true,
|
|
isScreenDefinitionRequired: true,
|
|
});
|
|
return post<ApiResponse<MemberDetailsRootObject>>(path, requestBody);
|
|
};
|
|
|
|
export const fillApplication = (applicationId: string, fields: Field[]) => {
|
|
const updatedPath = FILL_APPLICATION_PATH.replace(
|
|
":applicationId",
|
|
applicationId
|
|
);
|
|
|
|
const requestBody: AppFormData = {
|
|
fillRequest: {
|
|
applicationFields: {
|
|
fields: fields,
|
|
},
|
|
applicationType: "DEMO_11",
|
|
},
|
|
screenRequest: {
|
|
action: "NEXT",
|
|
isScreenDefinitionRequired: true,
|
|
sourceScreen: "home",
|
|
},
|
|
};
|
|
return patch<ApiResponse<FillApplicationResponse>>(updatedPath, requestBody);
|
|
};
|