diff --git a/Marco.Pms.Services/Service/ExpensesService.cs b/Marco.Pms.Services/Service/ExpensesService.cs index b6b5b41..e0864e2 100644 --- a/Marco.Pms.Services/Service/ExpensesService.cs +++ b/Marco.Pms.Services/Service/ExpensesService.cs @@ -2761,11 +2761,11 @@ namespace Marco.Pms.Services.Service try { // Validate if the employee Id from the URL path matches the Id in the request body (model) - if (id != model.Id || model.Id.HasValue) + if (id != model.Id) { // Log a warning with details for traceability when Ids do not match _logger.LogWarning("Mismatch detected: Path parameter Id ({PathId}) does not match body Id ({BodyId}) for employee {EmployeeId}", - id, model.Id ?? Guid.Empty, loggedInEmployee.Id); + id, model.Id, loggedInEmployee.Id); // Return standardized error response with HTTP 400 Bad Request status and clear message return ApiResponse.ErrorResponse("The employee Id in the path does not match the Id in the request body.",