ad6658e490
抽屉副标题/5 国家草稿与变更差异(空值→删除)纯逻辑, 保存走 PUT/DELETE
/api/admin/query-asins/{id}/countries/{country}, 9 个契约测试。
19 lines
829 B
TypeScript
19 lines
829 B
TypeScript
/** 查询 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}`
|
||
}
|
||
|
||
/** 保存某国家 ASIN(body { 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))
|
||
}
|