This commit is contained in:
2019-10-21 22:40:16 +00:00
parent 0ae191daca
commit de6ab566f0
7 changed files with 81 additions and 22 deletions

View File

@@ -316,9 +316,10 @@ namespace AyaNova.Api.Controllers
///
/// </summary>
/// <param name="inObj"></param>
/// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> PostUser([FromBody] User inObj)
public async Task<IActionResult> PostUser([FromBody] User inObj, ApiVersion apiVersion)
{
if (!serverState.IsOpen)
{
@@ -355,7 +356,7 @@ namespace AyaNova.Api.Controllers
//return success and link
//NOTE: this is a USER object so we don't want to return some key fields for security reasons
//which is why the object is "cleaned" before return
return CreatedAtAction("GetUser", new { id = o.Id }, new ApiCreatedResponse(UserBiz.CleanUserForReturn(o)));
return CreatedAtAction(nameof(UserController.GetUser), new { id = o.Id, version = apiVersion.ToString() }, new ApiCreatedResponse(UserBiz.CleanUserForReturn(o)));
}
}