削除タグが履歴で取得されるとフロントが落ちるバグ(#290) (#292)

#290

#290

'frontend/src/pages/posts/PostHistoryPage.tsx' を更新

'frontend/src/types.ts' を更新

Co-authored-by: miteruzo <miteruzo@naver.com>
Reviewed-on: #292
This commit was merged in pull request #292.
This commit is contained in:
2026-03-14 00:25:18 +09:00
parent d772cceb5e
commit bcce7f2011
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -71,7 +71,7 @@ export default (() => {
++rowsCnt
}
return (
<tr key={`${ change.timestamp }-${ change.post.id }-${ change.tag.id }`}
<tr key={`${ change.timestamp }-${ change.post.id }-${ change.tag?.id }`}
className={cn ('even:bg-gray-100 dark:even:bg-gray-700',
withPost && 'border-t')}>
{withPost && (
@@ -92,7 +92,9 @@ export default (() => {
</PrefetchLink>
</td>)}
<td className="p-2">
<TagLink tag={change.tag} withWiki={false} withCount={false}/>
{change.tag
? <TagLink tag={change.tag} withWiki={false} withCount={false}/>
: '(マスタ削除済のタグ) '}
{`${ change.changeType === 'add' ? '記載' : '消除' }`}
</td>
<td className="p-2">
+2 -2
View File
@@ -54,8 +54,8 @@ export type Post = {
export type PostTagChange = {
post: Post
tag: Tag
user?: User
tag: Tag | null
user: User | null
changeType: 'add' | 'remove'
timestamp: string }