Skip to content
Snippets Groups Projects
Commit 1e52e3e2 authored by Loïc Poullain's avatar Loïc Poullain
Browse files

Do not include gender and name in requests

parent 6326d88f
Branches
No related tags found
1 merge request!120Use new cas type format (request and redux state)
......@@ -8,6 +8,12 @@ const fetchMetadataCasTypes = () => (dispatch, getState) => {
.post("/metadata/description_cas_types")
.then((payload) => {
// dispatch(loadingComplete());
for (const casType of payload) {
casType.name = 'Foyer fiscal type';
for (const declarant of casType.declarants) {
declarant.gender = Math.random() < 0.49 ? 'male' : 'female';
}
}
dispatch({ payload, token, type: "onInitializeCasTypes" });
})
.catch((err) => { // eslint-disable-line no-unused-vars
......
......@@ -73,7 +73,20 @@ export const simulateCasTypes = () => (dispatch, getState) => {
const { descriptions, parameters } = getState() as RootState;
const body = {
description_cas_types: descriptions.ir.casTypes,
description_cas_types: descriptions.ir.casTypes.map(casType => ({
// No name
residence: casType.residence,
revenuImposable: casType.revenuImposable,
declarants: casType.declarants.map(declarant => ({
veuf: declarant.veuf,
retraite: declarant.retraite,
ancienCombattant: declarant.ancienCombattant,
invalide: declarant.invalide,
parentIsole: declarant.parentIsole,
// No gende
})),
personnesACharge: casType.personnesACharge,
})),
reforme: formatReforme(parameters.amendement),
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment