@galadrim/galadmin 0.1.211 → 0.1.212

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galadrim/galadmin",
3
- "version": "0.1.211",
3
+ "version": "0.1.212",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
package/src/api.ts CHANGED
@@ -923,13 +923,14 @@ export default (db, config, user) => {
923
923
  if (!config.inseeKey) {
924
924
  return res.status(403).send("inseeKey is not set in the config")
925
925
  }
926
+ const processedQuery = (req.query.query as any).replaceAll(" ", "-")
926
927
  const response = await axios.get(`https://api.insee.fr/entreprises/sirene/siret`, {
927
928
  headers: {
928
929
  "Authorization": `Bearer ${config.inseeKey}`,
929
930
  "Accept": "application/json"
930
931
  },
931
932
  params: {
932
- q: `denominationUniteLegale:${encodeURIComponent(req.query.query as any)}* OR siren:${encodeURIComponent(req.query.query as any)}*`,
933
+ q: `denominationUniteLegale:${processedQuery}* OR siren:${processedQuery}*`,
933
934
  nombre: 100
934
935
  }
935
936
  });