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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user