init
This commit is contained in:
parent
9b05c95972
commit
fe472aed44
@ -12,12 +12,12 @@ export const getItems = async (goofishId?: string): Promise<{ success: boolean;
|
||||
|
||||
// 删除商品
|
||||
export const deleteItem = (cookieId: string, itemId: string): Promise<ApiResponse> => {
|
||||
return del(`/items/${cookieId}/${itemId}`)
|
||||
return del(`/products/${cookieId}/${itemId}`)
|
||||
}
|
||||
|
||||
// 批量删除商品
|
||||
export const batchDeleteItems = (ids: { cookie_id: string; item_id: string }[]): Promise<ApiResponse> => {
|
||||
return del('/items/batch', { data: { items: ids } })
|
||||
export const batchDeleteItems = (ids: { goofish_id: string; item_id: string }[]): Promise<ApiResponse> => {
|
||||
return del('/products/batch', { data: { items: ids } })
|
||||
}
|
||||
|
||||
// 从账号获取商品(分页)
|
||||
@ -32,7 +32,7 @@ export const fetchAllItemsFromAccount = (cookieId: string): Promise<ApiResponse>
|
||||
|
||||
// 更新商品
|
||||
export const updateItem = (cookieId: string, itemId: string, data: Partial<Item>): Promise<ApiResponse> => {
|
||||
return put(`/items/${cookieId}/${itemId}`, data)
|
||||
return put(`/products/${cookieId}/${itemId}`, data)
|
||||
}
|
||||
|
||||
// 获取商品回复列表
|
||||
|
||||
@ -133,7 +133,7 @@ export function Items() {
|
||||
// 将选中的 ID 转换为 { cookie_id, item_id } 格式
|
||||
const itemsToDelete = items
|
||||
.filter((item) => selectedIds.has(item.id))
|
||||
.map((item) => ({ cookie_id: item.goofish_id, item_id: item.goofish_product_id }))
|
||||
.map((item) => ({ goofish_id: item.goofish_id, item_id: item.goofish_product_id }))
|
||||
await batchDeleteItems(itemsToDelete)
|
||||
addToast({ type: 'success', message: `成功删除 ${selectedIds.size} 个商品` })
|
||||
setSelectedIds(new Set())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user