削除タグが履歴で取得されるとフロントが落ちるバグ(#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 ++rowsCnt
} }
return ( 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', className={cn ('even:bg-gray-100 dark:even:bg-gray-700',
withPost && 'border-t')}> withPost && 'border-t')}>
{withPost && ( {withPost && (
@@ -92,7 +92,9 @@ export default (() => {
</PrefetchLink> </PrefetchLink>
</td>)} </td>)}
<td className="p-2"> <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' ? '記載' : '消除' }`} {`${ change.changeType === 'add' ? '記載' : '消除' }`}
</td> </td>
<td className="p-2"> <td className="p-2">
+2 -2
View File
@@ -54,8 +54,8 @@ export type Post = {
export type PostTagChange = { export type PostTagChange = {
post: Post post: Post
tag: Tag tag: Tag | null
user?: User user: User | null
changeType: 'add' | 'remove' changeType: 'add' | 'remove'
timestamp: string } timestamp: string }