Skip to content

Commit

Permalink
fix: fix search by corse departement
Browse files Browse the repository at this point in the history
  • Loading branch information
ImenOuidou committed Dec 21, 2023
1 parent ede9c98 commit 0fc6d99
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
5 changes: 1 addition & 4 deletions src/client/src/containers/Search/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
useSearchTerms,
} from "../../services/Store/hooks/search";
import { normalizeCodeCommunes } from "../../utils/code-commune/code-commune";
import { normalizeCodeDepartement } from "../../utils/code-departement/code-departement";
import { useFileDownload } from "../../utils/file-download/hooks";
import { useSort } from "../../utils/search-table/hooks";
import divisionsNaf from "./divisions-naf.json";
Expand All @@ -31,9 +30,7 @@ const formatLocationFilter = (filters) => {
codesCommunes: normalizeCodeCommunes(
locationFilters?.commune?.map(prop("value")) || []
),
departements: normalizeCodeDepartement(
locationFilters?.departement?.map(prop("value")) || []
),
departements: locationFilters?.departement?.map(prop("value")) || [],
};
};

Expand Down
16 changes: 0 additions & 16 deletions src/client/src/utils/code-departement/code-departement.js

This file was deleted.

6 changes: 3 additions & 3 deletions src/server/src/utils/elastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const filtersFieldMap = {
etats: "etatAdministratifEtablissement",
activites: "domaineActivite",
codesCommunes: "codeCommuneEtablissement",
departements: "departementEtablissement",
departement: "departement",
codesPostaux: "codesPostalEtablissement",
tranchesEffectifs: "trancheEffectifsEtablissement",
};
Expand Down Expand Up @@ -214,7 +214,7 @@ export const getElasticQueryParams = (req) => {
const activites = req.query["activites"] || [];
const codesCommunes = req.query["codesCommunes"] || [];
const codesPostaux = req.query["codesPostaux"] || [];
const departements = req.query["departements"] || [];
const departement = req.query["departements"] || [];
const tranchesEffectifs = req.query["tranchesEffectifs"] || [];
const dirigeant = req.query["dirigeant"]
? JSON.parse(req.query["dirigeant"])
Expand All @@ -233,7 +233,7 @@ export const getElasticQueryParams = (req) => {
etats,
activites,
codesCommunes,
departements,
departement,
codesPostaux,
tranchesEffectifs,
dirigeant,
Expand Down

0 comments on commit 0fc6d99

Please sign in to comment.