Skip to content
Snippets Groups Projects
Commit b83234b8 authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Ne plante pas quand une réforme introduit une nouvelle variable budgétaire sans inflateur donc

parent a66ae3fb
Branches
Tags 0.1.333
No related merge requests found
Pipeline #17688 passed
...@@ -20,12 +20,16 @@ ...@@ -20,12 +20,16 @@
reformName, reformName,
{ {
...reformParameter, ...reformParameter,
values: Object.fromEntries([ values:
reformParameter.values === undefined
? undefined
: Object.fromEntries([
...Object.entries(reformParameter.values), ...Object.entries(reformParameter.values),
[ [
"latest", "latest",
Object.entries(reformParameter.values).sort( Object.entries(reformParameter.values).sort(
([instant1], [instant2]) => instant2.localeCompare(instant1), ([instant1], [instant2]) =>
instant2.localeCompare(instant1),
)[0][1], )[0][1],
], ],
]), ]),
...@@ -35,9 +39,12 @@ ...@@ -35,9 +39,12 @@
) )
// Latest inflator // Latest inflator
$: billInflator = inflatorWithLatestByReformName?.[$billName] $: billInflator =
$billName === undefined
? undefined
: inflatorWithLatestByReformName?.[$billName]
$: billInflatorValueFormatted = $: billInflatorValueFormatted =
billInflator !== undefined billInflator?.values !== undefined
? formatValue(billInflator.values["latest"].value, billInflator.unit) ? formatValue(billInflator.values["latest"].value, billInflator.unit)
: undefined : undefined
</script> </script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment