From 869ba9858f1ab3149c5779ef7f04db6301735d22 Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 20 Jan 2026 16:38:53 +0100 Subject: [PATCH] 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. --- src/ReC.API/Controllers/ProfileController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReC.API/Controllers/ProfileController.cs b/src/ReC.API/Controllers/ProfileController.cs index 54568fd..6442399 100644 --- a/src/ReC.API/Controllers/ProfileController.cs +++ b/src/ReC.API/Controllers/ProfileController.cs @@ -29,7 +29,7 @@ public class ProfileController(IMediator mediator) : ControllerBase public async Task 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); } ///