From be66e65e5924a1f1fc840f95e251d5d38f634d08 Mon Sep 17 00:00:00 2001 From: DeepnaPooja Date: Thu, 3 Sep 2026 16:05:19 +0530 Subject: [PATCH] Update order controller --- Distribution/Features/Order/OrderController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Distribution/Features/Order/OrderController.cs b/Distribution/Features/Order/OrderController.cs index 97266bb..a5f528c 100644 --- a/Distribution/Features/Order/OrderController.cs +++ b/Distribution/Features/Order/OrderController.cs @@ -21,7 +21,7 @@ public class OrderController(OrderService service) : ControllerBase public async Task GetByStore(Guid storeId) { var result = await service.GetByStoreIdAsync(storeId); - return result is null ? Forbid() : Ok(result); + return result is null ? StatusCode(StatusCodes.Status403Forbidden) : Ok(result); } [HttpPost] @@ -30,7 +30,7 @@ public class OrderController(OrderService service) : ControllerBase try { var result = await service.CreateAsync(request, ct); - return result is null ? Forbid() : CreatedAtAction(nameof(GetById), new { id = result.Id }, result); + return result is null ? StatusCode(StatusCodes.Status403Forbidden) : CreatedAtAction(nameof(GetById), new { id = result.Id }, result); } catch (InvalidOperationException ex) { return BadRequest(new { error = ex.Message }); } }