Skip to content

Commit

Permalink
Merge pull request #422 from sohosai/fix/#410-form
Browse files Browse the repository at this point in the history
fix: 申請の数値項目で0が表示されない問題を修正
  • Loading branch information
appare45 authored Jul 24, 2024
2 parents 44bad27 + 9d868ab commit aaa624b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/common_components/form_answer/FormPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import dayjs from "dayjs";
import ja from "dayjs/locale/ja";

import { FormFieldsType } from "./FormItems";
import { getTimeLeftText, getSubmitStatusFromDate } from "@/lib/formHelpers";
import { getSubmitStatusFromDate, getTimeLeftText } from "@/lib/formHelpers";
import { type SubmitStatus, SubmitStatusBadge } from "@/common_components/SubmitStatus";
import { Loading } from "@/common_components/Loading";
import { FileView } from "@/common_components/FileView";
Expand All @@ -34,15 +34,15 @@ export const FormPage = ({ answer, answerError, answerLoading, form, formError,
answer.items.map((item) => {
switch (item.type) {
case "string":
return [item.item_id, item.value ? (item.value as string) : null];
return [item.item_id, item.value];
case "int":
return [item.item_id, item.value ? String(item.value) : null];
return [item.item_id, item.value];
case "choose_one":
return [item.item_id, item.value ? (item.value as string) : null];
return [item.item_id, item.value];
case "choose_many":
return [item.item_id, item.value ? JSON.stringify(item.value) : null];
return [item.item_id, JSON.stringify(item.value)];
case "file":
return [item.item_id, item.value ? (item.value as string[]) : null];
return [item.item_id, item.value];
}
}),
)
Expand Down

0 comments on commit aaa624b

Please sign in to comment.