|
@@ -1,4 +1,4 @@
|
|
|
-import { postJson } from '@/request';
|
|
|
|
|
|
|
+import { pageList, postJson } from '@/request';
|
|
|
|
|
|
|
|
export async function fetchCreateProduct(body: API.CreateProductReq) {
|
|
export async function fetchCreateProduct(body: API.CreateProductReq) {
|
|
|
return postJson<API.CreateProductResult>('/product/create', body);
|
|
return postJson<API.CreateProductResult>('/product/create', body);
|
|
@@ -12,8 +12,12 @@ export async function fetchUpdateProduct(body: API.UpdateProductReq) {
|
|
|
return postJson<API.Result>('/product/update', body);
|
|
return postJson<API.Result>('/product/update', body);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export async function fetchProductList(body: API.ProductListReq) {
|
|
|
|
|
- return postJson<API.ProductListResult>('/product/list', body);
|
|
|
|
|
|
|
+export async function fetchProductList(
|
|
|
|
|
+ params?: API.ReqList<API.ProductListReq>,
|
|
|
|
|
+ sorter?: { [key: string]: any },
|
|
|
|
|
+ filter?: { [key: string]: any },
|
|
|
|
|
+) {
|
|
|
|
|
+ return pageList<API.ProductListResult>('/product/list', params, sorter, filter);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export async function fetchProductDetail(body: API.ProductDetailReq) {
|
|
export async function fetchProductDetail(body: API.ProductDetailReq) {
|