diff --git a/components/application/applicationField.tsx b/components/application/applicationField.tsx index e9f3da6f..f887fae4 100644 --- a/components/application/applicationField.tsx +++ b/components/application/applicationField.tsx @@ -67,7 +67,7 @@ const ApplicationValue = ({ field }: ApplicationFieldProps) => { ); - case "DROPDOWN" || "MULTIPLE_CHOICE": + case "DROPDOWN": const value = field.options?.find((opt) => opt.id === field.value?.at(0)); if (value) { return ( @@ -89,6 +89,16 @@ const ApplicationValue = ({ field }: ApplicationFieldProps) => { ); } + case "MULTIPLE_CHOICE": + const selected_value = field.options?.find( + (opt) => opt.id === field.value?.at(0), + ); + if (selected_value) { + return
{selected_value.text}
; + } + + returnNo value
; + case "TEXTAREA": return ; diff --git a/lib/schemas/tally.ts b/lib/schemas/tally.ts index d12bc231..2344dba3 100644 --- a/lib/schemas/tally.ts +++ b/lib/schemas/tally.ts @@ -8,7 +8,7 @@ const TallyCheckboxes = z.object({ const TallyMultipleChoice = z.object({ type: z.literal("MULTIPLE_CHOICE"), - value: z.union([z.boolean(), z.string().uuid()]), + value: z.array(z.string().uuid()).nullable(), options: z.array(z.object({ id: z.string(), text: z.string() })).optional(), });