Files
crawler-plugin/admin-frontend-vue/src/pages/asin/query-asin-detail-api.ts
T
huangzd1997 ad6658e490 task-74(ASIN 数据中心): 实现查询 ASIN 详情抽屉
抽屉副标题/5 国家草稿与变更差异(空值→删除)纯逻辑, 保存走 PUT/DELETE
/api/admin/query-asins/{id}/countries/{country}, 9 个契约测试。
2026-09-05 16:09:31 +08:00

19 lines
829 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/** 查询 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))
}