task-74(ASIN 数据中心): 实现查询 ASIN 详情抽屉

抽屉副标题/5 国家草稿与变更差异(空值→删除)纯逻辑, 保存走 PUT/DELETE
/api/admin/query-asins/{id}/countries/{country}, 9 个契约测试。
This commit is contained in:
2026-09-05 16:09:31 +08:00
parent a9b4a56986
commit ad6658e490
3 changed files with 200 additions and 0 deletions
@@ -0,0 +1,18 @@
/** 查询 ASIN 详情抽屉保存适配(任务 74):PUT/DELETE /api/admin/query-asins/{id}/countries/{country}。 */
import { http } from '@/api/http'
export const QUERY_ASIN_DETAIL_ENDPOINT = '/api/admin/query-asins'
function countryUrl(id: number, country: string): string {
return `${QUERY_ASIN_DETAIL_ENDPOINT}/${id}/countries/${country}`
}
/** 保存某国家 ASINbody { asin });返回后由列表刷新回读最新行。 */
export async function updateQueryAsinCountryAsin(id: number, country: string, asin: string): Promise<void> {
await http.put<unknown>(countryUrl(id, country), { asin })
}
/** 删除某国家 ASIN(清空该站点 ASIN)。 */
export async function deleteQueryAsinCountryAsin(id: number, country: string): Promise<void> {
await http.delete<unknown>(countryUrl(id, country))
}