fix: multiple options input

fix/organizer-location
Udit Takkar 2023-10-26 01:26:45 +05:30
parent cc19baa38d
commit a7b01a3e0d
1 changed files with 10 additions and 1 deletions

View File

@ -311,8 +311,17 @@ export const ComponentForField = ({
if (!field.optionsInputs) {
throw new Error("Field optionsInputs is not defined");
}
const moreThanOneInPersonOptions = !!(
field.options.filter((field) => {
return field.value === "inPerson";
}).length > 1
);
const options = field.options.map((field) => {
return { ...field, value: field.value };
return {
...field,
value: field.value === "inPerson" && moreThanOneInPersonOptions ? field.label : field.value,
};
});
return field.options.length ? (