Commit a95bdaa3 authored by hasan khaddour's avatar hasan khaddour

fix problem response

parent 0f8a3073
...@@ -22,7 +22,11 @@ namespace PSManagement.Presentation.Controllers.ApiBase ...@@ -22,7 +22,11 @@ namespace PSManagement.Presentation.Controllers.ApiBase
} }
else else
{ {
return Problem(detail: result.Errors.FirstOrDefault(), statusCode: StatusCodes.Status400BadRequest); return Problem(
detail: result.ValidationErrors.FirstOrDefault().ErrorMessage,
statusCode: StatusCodes.Status400BadRequest,
title:result.ValidationErrors.FirstOrDefault().ErrorCode
);
} }
} }
......
...@@ -76,7 +76,7 @@ namespace PSManagement.Presentation.Controllers.Employees ...@@ -76,7 +76,7 @@ namespace PSManagement.Presentation.Controllers.Employees
return HandleResult(_mapper.Map<Result<IEnumerable<EmployeeResponse>>>(result)); return HandleResult(_mapper.Map<Result<IEnumerable<EmployeeResponse>>>(result));
} }
[HttpGet("Departments")] [HttpGet("GetDepartments")]
public async Task<IActionResult> GetDepartments() public async Task<IActionResult> GetDepartments()
{ {
var query = new GetDepartmentsQuery(); var query = new GetDepartmentsQuery();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment