feat: add admin web MVP
This commit is contained in:
18
admin-web/src/api/secondGoodsApi.ts
Normal file
18
admin-web/src/api/secondGoodsApi.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { SecondGoods } from '../types'
|
||||
import { apiGet, apiPut } from './http'
|
||||
|
||||
export function listSecondGoods(status?: string) {
|
||||
return apiGet<SecondGoods[]>('/api/admin/second-goods', status ? { status } : undefined)
|
||||
}
|
||||
|
||||
export function approveSecondGoods(id: number) {
|
||||
return apiPut<SecondGoods>(`/api/admin/second-goods/${id}/approve`)
|
||||
}
|
||||
|
||||
export function rejectSecondGoods(id: number, reason: string) {
|
||||
return apiPut<SecondGoods>(`/api/admin/second-goods/${id}/reject`, { reason })
|
||||
}
|
||||
|
||||
export function offShelfSecondGoods(id: number) {
|
||||
return apiPut<SecondGoods>(`/api/admin/second-goods/${id}/off-shelf`)
|
||||
}
|
||||
Reference in New Issue
Block a user