From be74d7521240ee2ab0899acf76038274568099e2 Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Mon, 27 Oct 2025 11:44:21 +0330 Subject: [PATCH] fix : admin shipment route --- .../admin/controllers/shipment.controller.ts | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/modules/admin/controllers/shipment.controller.ts b/src/modules/admin/controllers/shipment.controller.ts index 2fcf8c3..ce4632a 100644 --- a/src/modules/admin/controllers/shipment.controller.ts +++ b/src/modules/admin/controllers/shipment.controller.ts @@ -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); - } }