Skip to content

Commit

Permalink
fix: undefined values in Likert question matching
Browse files Browse the repository at this point in the history
Properly returns the `undefined` value instead of a `'undefined'` string
if the value is missing.
  • Loading branch information
kaljarv committed Sep 18, 2024
1 parent 86281fd commit c1517d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/lib/utils/matching/LikertQuestion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export class LikertQuestion extends OrdinalQuestion {
this.category = category;
}

normalizeValue(value: number): CoordinateOrMissing {
normalizeValue(value: number | undefined): CoordinateOrMissing {
// The current frontend implemenation of questions uses numbers for choice keys
return super.normalizeValue(`${value}`);
return super.normalizeValue(Number.isFinite(value) ? `${value}` : undefined);
}
}
/**
Expand Down

0 comments on commit c1517d4

Please sign in to comment.