aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/FormPage.tsx23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/pages/FormPage.tsx b/src/pages/FormPage.tsx
index de80e8a..b8518c0 100644
--- a/src/pages/FormPage.tsx
+++ b/src/pages/FormPage.tsx
@@ -244,19 +244,18 @@ function FormPage(): JSX.Element {
answers[question.id] = "";
break;
- case QuestionType.Checkbox:
- if (typeof options !== "string") {
- const keys: Map<string, string> = new Map();
- options.forEach((val, index) => {
- keys.set(val, `${("000" + index).slice(-4)}. ${val}`);
- });
- const pairs = {};
- keys.forEach((val, key) => {
- pairs[key] = !!prop.props.public_state.get(val);
- });
- answers[question.id] = pairs;
- }
+ case QuestionType.Checkbox: {
+ const parsed = new Map();
+
+ prop.props.public_state.forEach((value, key) => {
+ if (key !== "valid" && key !== "error") {
+ answers.set(key.slice(6), value);
+ }
+ });
+
+ answers[question.id] = parsed;
break;
+ }
default:
answers[question.id] = prop.props.public_state.get("value");