refactor: to return the result according to the RFC 7807 standard and add a traceId
This commit is contained in:
@ -81,7 +81,7 @@ public class ProfessorController(IMediator mediator) : BaseController
|
||||
public async Task<ActionResult<List<ProfessorResponse>>> GetDetails(string name)
|
||||
{
|
||||
if (string.IsNullOrEmpty(name) || name.Length < 4)
|
||||
return BadRequest($"The minimum number of characters is 4 (current: {name.Length}).");
|
||||
throw new ControllerArgumentException($"The minimum number of characters is 4 (current: {name.Length}).");
|
||||
|
||||
var result = await mediator.Send(new GetProfessorInfoSearchQuery()
|
||||
{
|
||||
|
Reference in New Issue
Block a user