diff --git a/src/hooks/useSuitable.ts b/src/hooks/useSuitable.ts index eb0b366..574e580 100644 --- a/src/hooks/useSuitable.ts +++ b/src/hooks/useSuitable.ts @@ -285,9 +285,9 @@ export function useSuitable() { const downloadSuitablePdf = async (): Promise => { try { const { ids, detailIds } = serializeSelectedItems() - const fileTitle = `(${ - suitableCommCode.get(SUITABLE_HEAD_CODE.ROOF_MATL_GRP_CD)?.find((category) => category.code === searchCategory)?.codeJp - }) 屋根材適合表` + + const category = suitableCommCode.get(SUITABLE_HEAD_CODE.ROOF_MATL_GRP_CD)?.find((category) => category.code === searchCategory)?.codeJp + const fileTitle = category ? `(${category}) 屋根材適合表` : '屋根材適合表' const form = document.createElement('form') form.method = 'POST'