Skip to content

Commit

Permalink
revert back POST api/order/shipments
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegoO committed Dec 20, 2023
1 parent f76a717 commit 4c8b903
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using VirtoCommerce.OrdersModule.Core;
using VirtoCommerce.OrdersModule.Core.Model;
using VirtoCommerce.OrdersModule.Core.Model.Search;
using VirtoCommerce.OrdersModule.Core.Services;
using VirtoCommerce.OrdersModule.Data.Authorization;
Expand All @@ -12,16 +13,27 @@ namespace VirtoCommerce.OrdersModule.Web.Controllers.Api
[Authorize]
public class OrderModuleShipmentsController : Controller
{
private readonly IShipmentService _shipmentService;
private readonly IShipmentSearchService _shipmentSearchService;
private readonly IAuthorizationService _authorizationService;

public OrderModuleShipmentsController(IShipmentSearchService shipmentSearchService,
public OrderModuleShipmentsController(IShipmentService shipmentService,
IShipmentSearchService shipmentSearchService,
IAuthorizationService authorizationService)
{
_shipmentService = shipmentService;
_shipmentSearchService = shipmentSearchService;
_authorizationService = authorizationService;
}

[HttpPost]
[Authorize(ModuleConstants.Security.Permissions.UpdateShipments)]
public async Task<ActionResult> UpdateShipment([FromBody] Shipment shipment)
{
await _shipmentService.SaveChangesAsync(new[] { shipment });

return Ok();
}

/// <summary>
/// Search shipments by given criteria
Expand Down

0 comments on commit 4c8b903

Please sign in to comment.