Skip to content

Commit

Permalink
ControlOption Value must always be a string
Browse files Browse the repository at this point in the history
  • Loading branch information
widoz committed Jan 13, 2024
1 parent a1316cf commit 07b1807
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sources/js/src/utils/convert-entities-to-control-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ export function convertEntitiesToControlOptions<
entities: OrderedSet<EntitiesFields>,
labelKey: string,
valueKey: string
): OrderedSet<EntitiesSearch.ControlOption<string | number>> {
): OrderedSet<EntitiesSearch.ControlOption<string>> {
const mutableOptions = entities.map((entity) => {
const label = entity[labelKey];
const value = entity[valueKey];
labelKeyIsString(label);
return makeControlOption(label, entity[valueKey]);
return makeControlOption(label, String(value));
});

return OrderedSet(mutableOptions);
Expand Down

0 comments on commit 07b1807

Please sign in to comment.