このコミットが含まれているのは:
2026-05-11 03:32:47 +09:00
コミット add60cb413
72個のファイルの変更1659行の追加247行の削除
+12 -5
ファイルの表示
@@ -23,9 +23,8 @@ const mdParser = new MarkdownIt
type Props = { user: User | null }
export default (({ user }: Props) => {
if (!(['admin', 'member'].some (r => user?.role === r)))
return <Forbidden/>
const WikiEditPage: FC<Props> = ({ user }) => {
const editable = ['admin', 'member'].some (r => user?.role === r)
const { id } = useParams ()
@@ -59,6 +58,9 @@ export default (({ user }: Props) => {
}
useEffect (() => {
if (!(editable))
return
void (async () => {
setLoading (true)
const data = await apiGet<WikiPage> (`/wiki/${ id }`)
@@ -66,7 +68,10 @@ export default (({ user }: Props) => {
setBody (data.body)
setLoading (false)
}) ()
}, [id])
}, [editable, id])
if (!(editable))
return <Forbidden/>
return (
<MainArea>
@@ -105,4 +110,6 @@ export default (({ user }: Props) => {
</>)}
</div>
</MainArea>)
}) satisfies FC<Props>
}
export default WikiEditPage