fix: 修复 BOM 删除时错误删除所有版本的问题

This commit is contained in:
dxc
2026-03-06 09:55:59 +08:00
parent 86fa5ef458
commit 8091c5f326

View File

@ -29,13 +29,13 @@ export function saveBom(data: any) {
}) })
} }
// 删除BOM(暂未实现,预留) // 删除BOM
export function deleteBom(bomNo: string) { export function deleteBom(bomNo: string, version: string) {
// 去除首尾斜杠,保留中间斜杠并进行 URL 编码 // 去除首尾斜杠,保留中间斜杠并进行 URL 编码
const trimmed = bomNo.replace(/^\/+|\/+$/g, ''); const trimmed = bomNo.replace(/^\/+|\/+$/g, '');
const encoded = encodeURIComponent(trimmed); const encoded = encodeURIComponent(trimmed);
return request({ return request({
url: `/v1/bom/${encoded}`, url: `/v1/bom/${encoded}?version=${encodeURIComponent(version)}`,
method: 'delete' method: 'delete'
}) })
} }