diff --git a/ui/v2.5/src/models/list-filter/criteria/gender.ts b/ui/v2.5/src/models/list-filter/criteria/gender.ts index b0291f11abe..3d7d50b1fb9 100644 --- a/ui/v2.5/src/models/list-filter/criteria/gender.ts +++ b/ui/v2.5/src/models/list-filter/criteria/gender.ts @@ -4,7 +4,11 @@ import { GenderEnum, } from "src/core/generated-graphql"; import { genderStrings, stringToGender } from "src/utils/gender"; -import { CriterionOption, MultiStringCriterion } from "./criterion"; +import { + CriterionOption, + IEncodedCriterion, + MultiStringCriterion, +} from "./criterion"; export const GenderCriterionOption = new CriterionOption({ messageID: "gender", @@ -33,4 +37,18 @@ export class GenderCriterion extends MultiStringCriterion { modifier: this.modifier, }; } + + public setFromEncodedCriterion( + encodedCriterion: IEncodedCriterion + ) { + // backwards compatibility - if the value is a string, convert it to an array + if (typeof encodedCriterion.value === "string") { + encodedCriterion = { + ...encodedCriterion, + value: [encodedCriterion.value], + }; + } + + super.setFromEncodedCriterion(encodedCriterion); + } }