Fixed a bug where repMandate wasn't the correct data
This commit is contained in:
@@ -20,7 +20,7 @@ const repFullName = computed(
|
|||||||
|
|
||||||
const repMandate = computed(() => {
|
const repMandate = computed(() => {
|
||||||
const parliamentMandate = props.rep.acteur.mandats.mandat.find(
|
const parliamentMandate = props.rep.acteur.mandats.mandat.find(
|
||||||
(mandate) => mandate["@xsi:type"] === "MandatParlementaire_type"
|
(mandate) => mandate.typeOrgane === "ASSEMBLEE"
|
||||||
);
|
);
|
||||||
return parliamentMandate;
|
return parliamentMandate;
|
||||||
});
|
});
|
||||||
@@ -55,12 +55,20 @@ const repLinkedin = computed(() => {
|
|||||||
return data;
|
return data;
|
||||||
});
|
});
|
||||||
|
|
||||||
const regionBgFile = computed(
|
const regionBgFile = computed(() => {
|
||||||
() =>
|
if (
|
||||||
`regions/${String(repMandate.value?.election?.lieu.region)
|
repMandate.value?.election?.lieu.departement ===
|
||||||
|
"Français établis hors de France"
|
||||||
|
) {
|
||||||
|
return `regions/fr-etranger-${String(
|
||||||
|
repMandate.value?.election?.lieu.numCirco
|
||||||
|
)}.svg`;
|
||||||
|
} else {
|
||||||
|
return `regions/${String(repMandate.value?.election?.lieu.region)
|
||||||
.toLocaleLowerCase()
|
.toLocaleLowerCase()
|
||||||
.replace(/\s/g, "-")}.svg`
|
.replace(/\s/g, "-")}.svg`;
|
||||||
);
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user