From 19c63ef317fa985f41558ba048c7b284f5b6ebb3 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 12:06:15 +0100 Subject: [PATCH] Fixed error with update of quantity in stock page --- PyroFetes/Endpoints/{ => WareHouse}/GetAllWarehouseEndpoint.cs | 2 +- .../WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename PyroFetes/Endpoints/{ => WareHouse}/GetAllWarehouseEndpoint.cs (92%) diff --git a/PyroFetes/Endpoints/GetAllWarehouseEndpoint.cs b/PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs similarity index 92% rename from PyroFetes/Endpoints/GetAllWarehouseEndpoint.cs rename to PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs index ac2c7a2..50bf272 100644 --- a/PyroFetes/Endpoints/GetAllWarehouseEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs @@ -2,7 +2,7 @@ using PyroFetes.DTO.WareHouse.Response; using PyroFetes.Repositories; -namespace PyroFetes.Endpoints; +namespace PyroFetes.Endpoints.WareHouse; public class GetAllWarehouseEndpoint(WareHouseRepository wareHouseRepository, AutoMapper.IMapper mapper) : EndpointWithoutRequest> { diff --git a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs index 2c43f8d..9e6733f 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs @@ -30,7 +30,7 @@ public class PatchWareHouseProductQuantityEndpoint(WarehouseProductsRepository w if (wareHouseProduct is null) await warehouseProductsRepository.AddAsync(mapper.Map(req), ct); else { - wareHouseProduct.Quantity = req.Quantity; + wareHouseProduct.Quantity += req.Quantity; await warehouseProductsRepository.SaveChangesAsync(ct); }