Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Add GetAttributeById api and add children filed
Browse files Browse the repository at this point in the history
  • Loading branch information
Jzow committed Oct 18, 2023
1 parent a0ec8b5 commit a0dc709
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/api/product/model/productCategoryModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface ProductCategoryResp {
remark: string;
sort: number;
createTime: string;
children?: ProductCategoryResp[];
}

export interface AddOrUpdateProductCategoryReq {
Expand Down
12 changes: 12 additions & 0 deletions src/api/product/productAttribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ enum Api {
List = '/product/attribute/list',
addOrUpdate = '/product/attribute/addOrUpdate',
deleteBatch = '/product/attribute/deleteBatch',
GetAttributeById = '/product/attribute/getValuesById',
}

export function getAttributeList(params: ProductAttributeListReq ,mode: ErrorMessageMode = 'notice') {
Expand Down Expand Up @@ -43,4 +44,15 @@ export function deleteBatchAttribute(ids: number[], mode: ErrorMessageMode = 'no
errorMessageMode: mode,
},
);
}

export function getAttributeById(id: number, mode: ErrorMessageMode = 'notice') {
return defHttp.get<BaseDataResp<ProductAttributeResp>>(
{
url: `${Api.GetAttributeById}?id=${id}`
},
{
errorMessageMode: mode,
},
);
}

0 comments on commit a0dc709

Please sign in to comment.