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

[Dotations] Enable PLF

parent 0a283130
No related branches found
No related tags found
1 merge request!103Ajouter le PLF 2021 (dotations)
......@@ -179,7 +179,7 @@ interface ResponseBody {
}
}
base: ResponseBody["amendement"]
plf?: ResponseBody["amendement"]
plf: ResponseBody["amendement"]
baseToAmendement: {
communes: {
dsr: {
......@@ -194,7 +194,7 @@ interface ResponseBody {
}
}
}
baseToPlf?: ResponseBody["baseToAmendement"]
baseToPlf: ResponseBody["baseToAmendement"]
}
export interface SimulateDotationsSuccessAction {
......
......@@ -26,31 +26,7 @@ export function dotations(
state: null,
};
case "SIMULATE_DOTATIONS_SUCCESS":
// TODO: remove this when the PLF is enabled.
// const { base, baseToPlf, plf } = action.dotations;
// if (!plf || !baseToPlf) {
// return {
// isFetching: false,
// state: null,
// };
// }
const { base } = action.dotations;
const baseToPlf = {
communes: {
dsr: {
nouvellementEligibles: 0,
plusEligibles: 0,
toujoursEligibles: 0,
},
dsu: {
nouvellementEligibles: 0,
plusEligibles: 0,
toujoursEligibles: 0,
},
},
};
const plf = base;
const { base, baseToPlf, plf } = action.dotations;
const dsr: DotationsDiffState["communes"]["dsr"] = {
...baseToPlf.communes.dsr,
communes: plf.communes.dsr.communes.map((commune, index) => ({
......
......@@ -29,9 +29,7 @@ export function dotations(
case "SIMULATE_DOTATIONS_SUCCESS":
return {
isFetching: false,
// TODO: remove this when the PLF is enabled.
// state: action.dotations.plf,
state: action.dotations.base,
state: action.dotations.plf,
};
case "REMOVE_COMMUNE_TYPE":
if (state.state === null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment