Skip to content

Commit 9aa344c

Browse files
committed
fix: updating patch info and banner error
1 parent 239edfc commit 9aa344c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/api/edit/update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const updatePatch = async (
3333
if (!patch) {
3434
return '该 ID 下未找到对应补丁'
3535
}
36-
if (currentUserUid !== patch.user_id || currentUserRole < 2) {
36+
if (currentUserUid !== patch.user_id && currentUserRole < 3) {
3737
return '您没有权限更新该游戏信息'
3838
}
3939

app/api/patch/banner/route.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ export const updatePatchBanner = async (
2626
if (typeof res === 'string') {
2727
return res
2828
}
29+
const imageLink = `${process.env.KUN_VISUAL_NOVEL_IMAGE_BED_URL}/patch/${patch.id}/banner/banner.avif`
30+
31+
await prisma.patch.update({
32+
where: { id: patch.id },
33+
data: { banner: imageLink }
34+
})
2935

3036
return {}
3137
}

0 commit comments

Comments
 (0)