delete variant
This commit is contained in:
@@ -515,4 +515,14 @@ export class AdminProductController extends BaseController {
|
||||
const { pager } = this.paginate(data.count);
|
||||
return this.response({ pager, products: data.products, brands: data.brands, categories: data.categories });
|
||||
}
|
||||
|
||||
@ApiOperation("Delete product variant as admin ")
|
||||
@ApiResponse("successfully", HttpStatus.Ok)
|
||||
@ApiParam("id", "id of product variant", true)
|
||||
@ApiAuth()
|
||||
@httpDelete("/variants/:id", Guard.authAdmin())
|
||||
public async removeVariant(@requestParam("id") variantId: string) {
|
||||
const data = await this.productService.softDeleteProductVariant(variantId);
|
||||
return this.response(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,17 +306,6 @@ class ProductController extends BaseController {
|
||||
return this.response(data);
|
||||
}
|
||||
|
||||
@ApiOperation("Delete product variant as admin ")
|
||||
@ApiResponse("successfully", HttpStatus.Ok)
|
||||
@ApiParam("id", "id of product variant", true)
|
||||
@ApiParam("variantId", "id of product variant", true)
|
||||
@ApiAuth()
|
||||
@httpDelete("/variants/:variantId", Guard.authAdmin())
|
||||
public async removeVariant(@queryParam() paramDto: SetFreeShipParamDto) {
|
||||
const data = await this.productService.softDeleteProductVariant( paramDto.variantId);
|
||||
return this.response(data);
|
||||
}
|
||||
|
||||
@ApiOperation("update a variant of product ==> need to login as seller")
|
||||
@ApiResponse("successfully", HttpStatus.Created)
|
||||
@ApiModel(UpdateVariantDTO)
|
||||
|
||||
Reference in New Issue
Block a user