Remove pending- prefix from publish table row keys

This commit is contained in:
CPTProgrammer 2026-07-18 21:16:32 +08:00
parent 120e701443
commit 54af762365
No known key found for this signature in database

View File

@ -276,8 +276,11 @@ export function PublishModal({
);
const modrinthRows: ModrinthTableRow[] = useMemo(() => {
// 行 key 发布时会作为 mc_version 直接传入后端 API严禁加任何前缀
// 此处曾加 "pending-" 前缀,导致后端准备阶段报 Invalid SemVer: "pending-1.19"。
// 教训:所有要传入 API 的 key 都不能加前缀(行类型区分请用 kind 字段)。
const pending: ModrinthTableRow[] = publishVersions.map((v) => ({
key: `pending-${v.key}`,
key: v.key,
kind: "pending",
pending: v,
modrinthVersion: v.modrinthVersion,
@ -316,8 +319,11 @@ export function PublishModal({
);
const curseforgeRows: CurseforgeTableRow[] = useMemo(() => {
// 行 key 发布时会作为 mc_version 直接传入后端 API严禁加任何前缀
// 此处曾加 "pending-" 前缀,导致后端准备阶段报 Invalid SemVer: "pending-1.19"。
// 教训:所有要传入 API 的 key 都不能加前缀(行类型区分请用 kind 字段)。
const pending: CurseforgeTableRow[] = publishVersions.map((v) => ({
key: `pending-${v.key}`,
key: v.key,
kind: "pending",
pending: v,
mc_version: v.mc_version,