fix: filtre département fonctionne mal

«Maine et Loire» ramènenait les familles «Loire Atlantique»
proto-module-actu-react
Jalil Arfaoui 2023-02-06 17:58:59 +01:00
parent 54440f6a0f
commit 00c13aeba8
1 changed files with 14 additions and 10 deletions

View File

@ -19,18 +19,18 @@ function FiltreDepartement(props: { onChange: (event: React.ChangeEvent<HTMLSele
<option value="Aude">Aude</option> <option value="Aude">Aude</option>
<option value="Aveyron">Aveyron</option> <option value="Aveyron">Aveyron</option>
<option value="Creuse">Creuse</option> <option value="Creuse">Creuse</option>
<option value="Sèvres">Deux-Sèvres</option> <option value="Deux-Sèvres">Deux-Sèvres</option>
<option value="Garonne">Haute-Garonne</option> <option value="Haute-Garonne">Haute-Garonne</option>
<option value="Savoie">Haute-Savoie</option> <option value="Haute-Savoie">Haute-Savoie</option>
<option value="Vienne">Haute-Vienne</option> <option value="Haute-Vienne">Haute-Vienne</option>
<option value="Vilaine">Ille-et-Vilaine</option> <option value="Ille-et-Vilaine">Ille-et-Vilaine</option>
<option value="Atlantique">Loire-Atlantique</option> <option value="Loire-Atlantique">Loire-Atlantique</option>
<option value="Lot">Lot</option> <option value="Lot">Lot</option>
<option value="Loire">Maine-et-Loire</option> <option value="Maine-et-Loire">Maine-et-Loire</option>
<option value="Moselle">Meurthe-et-Moselle</option> <option value="Meurthe-et-Moselle">Meurthe-et-Moselle</option>
<option value="Morbihan">Morbihan</option> <option value="Morbihan">Morbihan</option>
<option value="Dôme">Puy-de-Dôme</option> <option value="Puy-de-Dôme">Puy-de-Dôme</option>
<option value="Marne">Seine-et-Marne</option> <option value="Seine-et-Marne">Seine-et-Marne</option>
<option value="Tarn">Tarn</option> <option value="Tarn">Tarn</option>
<option value="Vaucluse">Vaucluse</option> <option value="Vaucluse">Vaucluse</option>
<option value="Vendée">Vendée</option> <option value="Vendée">Vendée</option>
@ -47,6 +47,10 @@ export const ListeResistants = () => {
const [departement, setDepartement] = React.useState<string|null>(null) const [departement, setDepartement] = React.useState<string|null>(null)
const [nom, setNom] = React.useState<string|undefined>(undefined) const [nom, setNom] = React.useState<string|undefined>(undefined)
console.log("département set to ", departement)
console.log("normalized to :", normalize(departement ||''))
const filtreDepartements = (event: React.ChangeEvent<HTMLSelectElement>) => setDepartement(event.target.value) const filtreDepartements = (event: React.ChangeEvent<HTMLSelectElement>) => setDepartement(event.target.value)
const filtreNom = (event: React.ChangeEvent<HTMLInputElement>) => setNom(event.target.value) const filtreNom = (event: React.ChangeEvent<HTMLInputElement>) => setNom(event.target.value)