Ver Fonte

fix: add missing DeleteDeptReq and ProductDetailReq types

BaiLuoYan há 3 dias atrás
pai
commit
1d41af1bca

+ 1 - 1
src/services/dept/index.ts

@@ -12,6 +12,6 @@ export async function fetchUpdateDept(body: API.UpdateDeptReq) {
   return request<API.Result>('/dept/update', { method: 'POST', data: body });
 }
 
-export async function fetchDeleteDept(body: { id: number }) {
+export async function fetchDeleteDept(body: API.DeleteDeptReq) {
   return request<API.Result>('/dept/delete', { method: 'POST', data: body });
 }

+ 4 - 0
src/services/dept/typings.d.ts

@@ -29,6 +29,10 @@ declare namespace API {
     status?: number;
   }
 
+  interface DeleteDeptReq {
+    id: number;
+  }
+
   type DeptTreeResult = Result<DeptItem[]>;
   type DeptCreateResult = Result<{ id: number }>;
 }

+ 1 - 1
src/services/product/index.ts

@@ -19,6 +19,6 @@ export async function fetchProductList(body: API.ProductListReq) {
   return request<API.ProductListResult>('/product/list', { method: 'POST', data: body });
 }
 
-export async function fetchProductDetail(body: { id: number }) {
+export async function fetchProductDetail(body: API.ProductDetailReq) {
   return request<API.ProductDetailResult>('/product/detail', { method: 'POST', data: body });
 }

+ 4 - 0
src/services/product/typings.d.ts

@@ -44,6 +44,10 @@ declare namespace API {
     pageSize?: number;
   }
 
+  interface ProductDetailReq {
+    id: number;
+  }
+
   type CreateProductResult = Result<CreateProductResp>;
   type FetchCredentialsResult = Result<FetchInitialCredentialsResp>;
   type ProductDetailResult = Result<ProductItem>;