fix: 대체된 사용자 아이템 보존 및 상태 표시

This commit is contained in:
2026-04-06 11:00:02 +09:00
parent a716ee0062
commit c7cafb87c3
6 changed files with 90 additions and 37 deletions

View File

@@ -33,6 +33,7 @@ const {
findUnusedCustomItems,
findCustomItemsByIds,
deleteCustomItems,
markCustomItemReplaced,
listUsers,
findPrimaryAdminUser,
listAdminTierLists,
@@ -835,10 +836,12 @@ router.post('/custom-items/:itemId/replace', requireAdmin, async (req, res) => {
toSrc: targetItem.src,
toLabel: targetItem.label || '',
})
const sourceCustomItems = await findCustomItemsByIds([sourceItem.id])
await deleteCustomItems([sourceItem.id])
await removeCustomItemFiles(sourceCustomItems)
await markCustomItemReplaced({
itemId: sourceItem.id,
replacedByItemId: targetItem.id || '',
replacedBySrc: targetItem.src || '',
replacedByLabel: targetItem.label || '',
})
res.json({
ok: true,