Update ProfileController to use CreatedAtAction in Post

Changed the Post method to return CreatedAtAction, providing a Location header linking to the new profile resource, in line with RESTful best practices.
This commit is contained in:
2026-01-20 16:38:53 +01:00
parent 5dee104377
commit 869ba9858f

View File

@@ -29,7 +29,7 @@ public class ProfileController(IMediator mediator) : ControllerBase
public async Task<IActionResult> Post([FromBody] InsertProfileProcedure procedure, CancellationToken cancel)
{
var id = await mediator.ExecuteInsertProcedure(procedure, cancel: cancel);
return StatusCode(StatusCodes.Status201Created, id);
return CreatedAtAction(nameof(Get), new { id }, id);
}
/// <summary>