Skip to content

Commit 33931eb

Browse files
committed
fix: cannot get patch release on fetching data
1 parent 0ed5a2c commit 33931eb

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

components/edit/create/BannerImage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const BannerImage = ({ errors }: Props) => {
4040

4141
return (
4242
<div className="space-y-2">
43-
<h2 className="text-xl">二、预览图片</h2>
43+
<h2 className="text-xl">预览图片</h2>
4444
<p>
4545
注意, <b>您不可以使用 R18 图片作为封面</b>, 如果有, 请更换图片, 打码,
4646
或者裁剪

components/edit/create/VNDBInput.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const VNDBInput = ({ errors }: Props) => {
3939

4040
return (
4141
<div className="flex flex-col w-full space-y-2">
42-
<h2 className="text-xl">一、VNDB ID</h2>
42+
<h2 className="text-xl">VNDB ID</h2>
4343
<Input
4444
variant="underlined"
4545
labelPlacement="outside"
@@ -68,6 +68,10 @@ export const VNDBInput = ({ errors }: Props) => {
6868
直到我们建成数据库之后才可以编辑标签、角色等数据, 无 VNDB ID
6969
只能在重新编辑页面编辑游戏名和介绍
7070
</p>
71+
<p className="text-lg font-bold text-danger">
72+
目前由于技术过于复杂, 为简单起见 VNDB ID 发布后暂时无法更改
73+
请您务必在发布游戏之前检查 VNDB 的正确性, 确保不要写错数字
74+
</p>
7175
<Link
7276
isExternal
7377
target="_blank"

components/edit/rewrite/RewritePatch.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,6 @@ export const RewritePatch = () => {
8181
</div>
8282
</CardHeader>
8383
<CardBody className="mt-4 space-y-12">
84-
<VNDBInput
85-
vndbId={data.vndbId}
86-
setVNDBId={(id) =>
87-
setData({
88-
...data,
89-
vndbId: id
90-
})
91-
}
92-
errors={errors.vndbId}
93-
/>
94-
9584
<MultiLangNameInput
9685
name={data.name}
9786
onChange={(name) => setData({ ...data, name })}

components/edit/shared/MultiLangNameInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Props {
88

99
export const MultiLangNameInput = ({ name, onChange, error }: Props) => (
1010
<div className="space-y-2">
11-
<h2 className="text-xl">三、游戏名称</h2>
11+
<h2 className="text-xl">游戏名称</h2>
1212
<p className="text-sm text-default-500">写一个就可以, 不写也行, 随便你</p>
1313
<div className="grid sm:grid-cols-3 grid-cols-1 gap-2">
1414
<Input

components/edit/shared/TabbedIntroduction.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const TabbedIntroduction = ({
2323
return (
2424
<div className="space-y-2">
2525
<div className="flex items-center justify-between">
26-
<h2 className="text-xl">四、简介</h2>
26+
<h2 className="text-xl">简介</h2>
2727

2828
{currentText && (
2929
<div className="hidden md:flex gap-2 text-sm text-default-500">

migration/sync-ts/mapping/patch.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,15 @@ export async function fetchVndbDetailAndSyncNames(
7676
if (olang === 'ja' && alt) nameJa = String(alt)
7777
}
7878
} catch {}
79+
const releasedVal = String((vnDetail as any).released || '').trim()
7980
await prisma.patch
8081
.update({
8182
where: { id: patchId },
82-
data: { name_en_us: nameEn, name_ja_jp: nameJa }
83+
data: {
84+
name_en_us: nameEn,
85+
name_ja_jp: nameJa,
86+
...(releasedVal ? { released: releasedVal } : {})
87+
}
8388
})
8489
.catch(() => {})
8590
try {

0 commit comments

Comments
 (0)