From e76503c729eea54eac667fe4203bc3e7b400e5da Mon Sep 17 00:00:00 2001 From: miteruzo Date: Mon, 13 Oct 2025 15:18:05 +0900 Subject: [PATCH 1/2] =?UTF-8?q?#100=20=E5=AE=8C=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/TagLink.tsx | 2 +- frontend/src/pages/wiki/WikiDetailPage.tsx | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/TagLink.tsx b/frontend/src/components/TagLink.tsx index 0734d4d..67fe389 100644 --- a/frontend/src/components/TagLink.tsx +++ b/frontend/src/components/TagLink.tsx @@ -7,7 +7,7 @@ import type { ComponentProps, FC, HTMLAttributes } from 'react' import type { Tag } from '@/types' -type CommonProps = { tag: Tag +type CommonProps = { tag: Pick withWiki?: boolean withCount?: boolean } diff --git a/frontend/src/pages/wiki/WikiDetailPage.tsx b/frontend/src/pages/wiki/WikiDetailPage.tsx index 058a5fc..b5ebd79 100644 --- a/frontend/src/pages/wiki/WikiDetailPage.tsx +++ b/frontend/src/pages/wiki/WikiDetailPage.tsx @@ -36,9 +36,16 @@ export default () => { if (/^\d+$/.test (title)) { void (async () => { - const res = await axios.get (`${ API_BASE_URL }/wiki/${ title }`) - const data = res.data as WikiPage - navigate (`/wiki/${ data.title }`, { replace: true }) + try + { + const res = await axios.get (`${ API_BASE_URL }/wiki/${ title }`) + const data = res.data as WikiPage + navigate (`/wiki/${ encodeURIComponent(data.title) }`, { replace: true }) + } + catch + { + ; + } }) () return @@ -51,6 +58,8 @@ export default () => { `${ API_BASE_URL }/wiki/title/${ encodeURIComponent (title) }`, { params: version ? { version } : { } }) const data = toCamel (res.data as any, { deep: true }) as WikiPage + if (data.title !== title) + navigate (`/wiki/${ encodeURIComponent(data.title) }`, { replace: true }) setWikiPage (data) WikiIdBus.set (data.id) } -- 2.34.1 From 851e8456bbba37a0351d9bd5a221a993d80a8492 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Mon, 13 Oct 2025 15:37:07 +0900 Subject: [PATCH 2/2] =?UTF-8?q?#100=20=E8=A6=81=E3=82=89=E3=82=93=E3=81=A8?= =?UTF-8?q?=E3=81=93=E5=A4=89=E3=81=B8=E3=81=A6=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E7=9B=B4=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/TagLink.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/TagLink.tsx b/frontend/src/components/TagLink.tsx index 67fe389..0734d4d 100644 --- a/frontend/src/components/TagLink.tsx +++ b/frontend/src/components/TagLink.tsx @@ -7,7 +7,7 @@ import type { ComponentProps, FC, HTMLAttributes } from 'react' import type { Tag } from '@/types' -type CommonProps = { tag: Pick +type CommonProps = { tag: Tag withWiki?: boolean withCount?: boolean } -- 2.34.1