19 lines
624 B
TypeScript
19 lines
624 B
TypeScript
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`)
|
|
}
|