task-77(ASIN 数据中心): 实现最低价 ASIN 详情编辑抽屉

抽屉副标题/5 国家草稿(ASIN+最低价)与变更差异(清空 ASIN→删除, 仅清价→
update)纯逻辑, 保存走 PUT/DELETE /api/admin/skip-price-asins/{id}/countries/{country},
10 个契约测试。
This commit is contained in:
2026-09-05 16:14:22 +08:00
parent d9b1b980ca
commit c1d6ce6d20
3 changed files with 227 additions and 0 deletions
@@ -0,0 +1,23 @@
/** 最低价 ASIN 详情编辑抽屉保存适配(任务 77):PUT/DELETE /api/admin/skip-price-asins/{id}/countries/{country}。 */
import { http } from '@/api/http'
export const SKIP_PRICE_DETAIL_ENDPOINT = '/api/admin/skip-price-asins'
function countryUrl(id: number, country: string): string {
return `${SKIP_PRICE_DETAIL_ENDPOINT}/${id}/countries/${country}`
}
/** 保存某国家 ASIN 与最低价(body { asin, minimumPrice });返回后由列表刷新回读最新行。 */
export async function updateSkipPriceCountry(
id: number,
country: string,
asin: string,
minimumPrice: number | null,
): Promise<void> {
await http.put<unknown>(countryUrl(id, country), { asin, minimumPrice })
}
/** 删除某国家最低价 ASIN(清空该站点)。 */
export async function deleteSkipPriceCountry(id: number, country: string): Promise<void> {
await http.delete<unknown>(countryUrl(id, country))
}