add product sku
This commit is contained in:
+46
-2
@@ -5,7 +5,11 @@ import type {
|
||||
ProductCategoryPage,
|
||||
ProductPage,
|
||||
ProductPageResult,
|
||||
ProductSku,
|
||||
ProductSpec,
|
||||
ProductSpecValue,
|
||||
ProductStock,
|
||||
ProductStockProduct,
|
||||
ProductStockChangeRequest,
|
||||
ProductStockManualRevokeRequest,
|
||||
ProductStockPage,
|
||||
@@ -57,6 +61,34 @@ async function disable(id: string): Promise<void> {
|
||||
await axios.post(`${PRODUCT_URI}/disable`, undefined, { params: { id } });
|
||||
}
|
||||
|
||||
async function skuDetail(id: string): Promise<ProductSku> {
|
||||
return await axios.post(`${PRODUCT_URI}/sku/detail`, undefined, { params: { id } });
|
||||
}
|
||||
|
||||
async function skuCreate(sku: ProductSku): Promise<string> {
|
||||
return await axios.post(`${PRODUCT_URI}/sku/create`, withCurrentStoreId(sku));
|
||||
}
|
||||
|
||||
async function skuUpdate(sku: ProductSku): Promise<void> {
|
||||
await axios.post(`${PRODUCT_URI}/sku/update`, withCurrentStoreId(sku));
|
||||
}
|
||||
|
||||
async function skuDisable(id: string): Promise<void> {
|
||||
await axios.post(`${PRODUCT_URI}/sku/disable`, undefined, { params: { id } });
|
||||
}
|
||||
|
||||
async function specList(productId: string): Promise<ProductSpec[]> {
|
||||
return await axios.post(`${PRODUCT_URI}/spec/list`, undefined, { params: { productId } });
|
||||
}
|
||||
|
||||
async function specCreate(spec: ProductSpec): Promise<string> {
|
||||
return await axios.post(`${PRODUCT_URI}/spec/create`, spec);
|
||||
}
|
||||
|
||||
async function specValueCreate(value: ProductSpecValue): Promise<string> {
|
||||
return await axios.post(`${PRODUCT_URI}/spec/value/create`, value);
|
||||
}
|
||||
|
||||
async function sellableList(page: ProductPage): Promise<Product[]> {
|
||||
return await axios.post(`${PRODUCT_URI}/sellable/list`, withCurrentStoreId(page));
|
||||
}
|
||||
@@ -65,9 +97,13 @@ async function stockList(page: ProductStockPage): Promise<ProductPageResult<Prod
|
||||
return await axios.post(`${STOCK_URI}/list`, withCurrentStoreId(page));
|
||||
}
|
||||
|
||||
async function stockDetail(productId: string, storeId?: string): Promise<ProductStock> {
|
||||
async function stockProductList(page: ProductStockPage): Promise<ProductPageResult<ProductStockProduct>> {
|
||||
return await axios.post(`${STOCK_URI}/product-list`, withCurrentStoreId(page));
|
||||
}
|
||||
|
||||
async function stockDetail(skuId: string, storeId?: string): Promise<ProductStock> {
|
||||
return await axios.post(`${STOCK_URI}/detail`, undefined, {
|
||||
params: { productId, storeId: storeId || getCurrentStoreId() }
|
||||
params: { skuId, storeId: storeId || getCurrentStoreId() }
|
||||
});
|
||||
}
|
||||
|
||||
@@ -114,8 +150,16 @@ export default {
|
||||
create,
|
||||
update,
|
||||
disable,
|
||||
skuDetail,
|
||||
skuCreate,
|
||||
skuUpdate,
|
||||
skuDisable,
|
||||
specList,
|
||||
specCreate,
|
||||
specValueCreate,
|
||||
sellableList,
|
||||
stockList,
|
||||
stockProductList,
|
||||
stockDetail,
|
||||
initialIn,
|
||||
manualIn,
|
||||
|
||||
Reference in New Issue
Block a user