Skip to content

Commit

Permalink
pkg: upgrade @betagouv/aides-velo
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileRolley committed Nov 13, 2024
1 parent 04f1dc9 commit c13649f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"yaml": "^2.3.4"
},
"dependencies": {
"@betagouv/aides-velo": "^0.1.0",
"@betagouv/aides-velo": "^0.2.0",
"@etalab/decoupage-administratif": "^4.0.0",
"fuzzysort": "^2.0.4",
"jsdom": "^23.0.1",
Expand Down
4 changes: 2 additions & 2 deletions retrofit/routes/api/ville/+server.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { data } from '@betagouv/aides-velo';
import { error } from '@sveltejs/kit';
import communes from '$lib/data/communes.json';
import { rawCityToFullLocalisation } from '$lib/utils';

export function GET({ url }) {
const slug = url.searchParams.get('slug');
const ville = data.communes.find((v) => v.slug === slug);
const ville = communes.find((v) => v.slug === slug);
if (!ville) {
error(404);
}
Expand Down
3 changes: 1 addition & 2 deletions src/lib/engine.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import Engine, { type Situation } from 'publicodes';
import { rules as aidesVelo } from '@betagouv/aides-velo';
// @ts-ignore
import aidesRetrofit from '$lib/../../retrofit/aides.yaml';
import { IS_RETROFIT } from './env';
import { aidesVeloEngine } from './aides-velo-utils';

export const engine: Engine = IS_RETROFIT
? new Engine(aidesRetrofit)
: aidesVeloEngine?.getEngine() ?? new Engine(aidesVelo);
: aidesVeloEngine?.getEngine();

export function getEngine(situation: Situation<string>): Engine {
const engineBis = engine.shallowCopy();
Expand Down

0 comments on commit c13649f

Please sign in to comment.