Skip to content

Commit

Permalink
fix: use the new @betagouv/aides-velo API
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileRolley committed Nov 13, 2024
1 parent c13649f commit a1eea54
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/lib/components/Questions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
export let goals = undefined;
export let demandeNeufOuOccasion = false;
// FIXME: a better way to handle this should exists
$: engine = getEngine({
...$publicodeSituation,
'vélo . type': veloTypeValue,
'vélo . type': $veloTypeValue,
});
const getSortOrder = (name: QuestionNames) =>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const resetAnswers = () => {
}
};

export const veloTypeValue: Readable<Situation['vélo . type']> = derived([veloCat], ([$veloCat]) =>
export const veloTypeValue = derived([veloCat], ([$veloCat]) =>
$veloCat !== null ? (`'${$veloCat}'` as Situation['vélo . type']) : null,
);

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/associate-collectivities.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { rules } from '@betagouv/aides-velo';
import rules from '@betagouv/aides-velo/rules';
import { writeJsonData } from './writeData.js';
import Publicodes, { reduceAST } from 'publicodes';

Expand Down
4 changes: 2 additions & 2 deletions src/scripts/generate-miniatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* from them.
*/
import fs from 'fs';
import { data } from '@betagouv/aides-velo';
import { miniatures } from '@betagouv/aides-velo/data';
import sharp from 'sharp';
import { join } from 'path';

Expand All @@ -20,7 +20,7 @@ if (fs.existsSync(miniatureDirectory)) {
fs.mkdirSync(miniatureDirectory, { recursive: true });

const thumbnailsManifest = Object.keys(aidesWithCollectivities).reduce((acc, id) => {
const imgSrc = data.miniatures[id];
const imgSrc = miniatures[id];

if (!imgSrc) {
return acc;
Expand Down

0 comments on commit a1eea54

Please sign in to comment.