Skip to content

Commit

Permalink
Treat likelihood as a number in forms
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Dec 10, 2024
1 parent ab748f5 commit fd2f719
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontend/src/lib/utils/crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,9 +708,9 @@ export const URL_MODEL_MAP: ModelMap = {
foreignKeyFields: [
{ field: 'ebios_rm_study', urlModel: 'ebios-rm' },
{ field: 'threats', urlModel: 'threats' },
{ field: 'attack_paths', urlModel: 'attack_paths' }
{ field: 'attack_paths', urlModel: 'attack-paths' }
],
selectFields: [{ field: 'likelihood' }]
selectFields: [{ field: 'likelihood', valueType: 'number' }]
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const load: PageServerLoad = async ({ params, fetch }) => {
selectOptions[selectField.field] = await response.json().then((data) =>
Object.entries(data).map(([key, value]) => ({
label: value,
value: key
value: selectField.valueType === 'number' ? parseInt(key) : key
}))
);
} else {
Expand Down

0 comments on commit fd2f719

Please sign in to comment.