Skip to content

Commit

Permalink
fix: remove stub insee, use wildcard (#1461)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmonnier9 authored Dec 16, 2024
1 parent d3c051c commit 1746000
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions clients/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ const routes = {
sireneInsee: {
auth: 'https://auth.insee.net/auth/realms/apim-gravitee/protocol/openid-connect/token',
avis: 'https://api-avis-situation-sirene.insee.fr/identification/pdf/',
siren: 'https://api.insee.fr/api-sirene/prive/3.11/siren/',
siret: 'https://api.insee.fr/api-sirene/prive/3.11/siret/',
getBySiren: (siren: string) =>
`https://api.insee.fr/api-sirene/prive/3.11/siren/${siren}`,
getBySiret: (siret: string) =>
`https://api.insee.fr/api-sirene/prive/3.11/siret/${siret}`,
},
rechercheEntreprise: {
rechercheUniteLegale: 'https://recherche-entreprises.api.gouv.fr/search',
Expand Down
2 changes: 1 addition & 1 deletion clients/sirene-insee/siren.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const clientUniteLegaleInsee = async (

const clientTmpUniteLegale = async (siren: Siren, useFallback: boolean) => {
const dataUniteLegale = await inseeClientGet<IInseeUniteLegaleResponse>(
routes.sireneInsee.siren + siren,
routes.sireneInsee.getBySiren(siren),
{},
useFallback
);
Expand Down
4 changes: 2 additions & 2 deletions clients/sirene-insee/siret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const clientAllEtablissementsInsee = async (

const { header, etablissements } =
await inseeClientGet<IInseeEtablissementsResponse>(
routes.sireneInsee.siret,
routes.sireneInsee.getBySiret(''),
{
params: {
q: `siren:${siren}`,
Expand Down Expand Up @@ -130,7 +130,7 @@ export const clientEtablissementInsee = async (
) => {
const { etablissement, etablissements } =
await inseeClientGet<IInseeEtablissementResponse>(
routes.sireneInsee.siret + siret,
routes.sireneInsee.getBySiret(siret),
{},
useFallback
);
Expand Down
4 changes: 2 additions & 2 deletions cypress/mocks/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ export const routesHandlers = [
http.get(routes.educationNationale.search, educationNationaleHandler),
http.get(routes.ban, baseAdresseNationaleHandler),
http.post(routes.sireneInsee.auth, apiSireneInseeAuthHandler),
http.get(routes.sireneInsee.siret, apiSireneInseeSiretHandler),
http.get(routes.sireneInsee.siren, apiSireneInseeSirenHandler),
http.get(routes.sireneInsee.getBySiret('*'), apiSireneInseeSiretHandler),
http.get(routes.sireneInsee.getBySiren('*'), apiSireneInseeSirenHandler),
];

0 comments on commit 1746000

Please sign in to comment.