fix : admin shipment route
This commit is contained in:
@@ -33,6 +33,26 @@ export class AdminShipmentController extends BaseController {
|
||||
return this.response({ data }, HttpStatus.Created);
|
||||
}
|
||||
|
||||
@ApiOperation("activate the admin shop shipment method")
|
||||
@ApiModel(UpdateShopShipmentDTO)
|
||||
@ApiAuth()
|
||||
@httpPatch("/activate", Guard.authAdmin(), ValidationMiddleware.validateInput(UpdateShopShipmentDTO))
|
||||
public async activateShopShipper(@request() req: Request, @requestBody() updateDto: UpdateShopShipmentDTO) {
|
||||
const admin = req.user as IAdmin;
|
||||
const data = await this.sellerService.updateShopShipperForAdmin(admin._id.toString(), updateDto, "activate");
|
||||
return this.response(data);
|
||||
}
|
||||
|
||||
@ApiOperation("deactivate the admin shop shipment method")
|
||||
@ApiModel(UpdateShopShipmentDTO)
|
||||
@ApiAuth()
|
||||
@httpPatch("/deactivate", Guard.authAdmin(), ValidationMiddleware.validateInput(UpdateShopShipmentDTO))
|
||||
public async deactivateShopShipper(@request() req: Request, @requestBody() updateDto: UpdateShopShipmentDTO) {
|
||||
const admin = req.user as IAdmin;
|
||||
const data = await this.sellerService.updateShopShipperForAdmin(admin._id.toString(), updateDto, "deactivate");
|
||||
return this.response(data);
|
||||
}
|
||||
|
||||
@ApiOperation("update a shipment provider")
|
||||
@ApiResponse("successful", HttpStatus.Ok)
|
||||
@ApiParam("id", "shipment provider id", true)
|
||||
@@ -63,24 +83,4 @@ export class AdminShipmentController extends BaseController {
|
||||
const data = await this.shipmentService.getShipperDetail(+shipperId);
|
||||
return this.response(data);
|
||||
}
|
||||
|
||||
@ApiOperation("activate the admin shop shipment method")
|
||||
@ApiModel(UpdateShopShipmentDTO)
|
||||
@ApiAuth()
|
||||
@httpPatch("/activate", Guard.authAdmin(), ValidationMiddleware.validateInput(UpdateShopShipmentDTO))
|
||||
public async activateShopShipper(@request() req: Request, @requestBody() updateDto: UpdateShopShipmentDTO) {
|
||||
const admin = req.user as IAdmin;
|
||||
const data = await this.sellerService.updateShopShipperForAdmin(admin._id.toString(), updateDto, "activate");
|
||||
return this.response(data);
|
||||
}
|
||||
|
||||
@ApiOperation("deactivate the admin shop shipment method")
|
||||
@ApiModel(UpdateShopShipmentDTO)
|
||||
@ApiAuth()
|
||||
@httpPatch("/deactivate", Guard.authAdmin(), ValidationMiddleware.validateInput(UpdateShopShipmentDTO))
|
||||
public async deactivateShopShipper(@request() req: Request, @requestBody() updateDto: UpdateShopShipmentDTO) {
|
||||
const admin = req.user as IAdmin;
|
||||
const data = await this.sellerService.updateShopShipperForAdmin(admin._id.toString(), updateDto, "deactivate");
|
||||
return this.response(data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user