diff --git a/server/AyaNova/Controllers/FormCustomController.cs b/server/AyaNova/Controllers/FormCustomController.cs
index 72e61171..e40361e4 100644
--- a/server/AyaNova/Controllers/FormCustomController.cs
+++ b/server/AyaNova/Controllers/FormCustomController.cs
@@ -131,15 +131,14 @@ namespace AyaNova.Api.Controllers
///
/// Put (update) FormCustom
///
- /// Required roles:
- /// Any (public filter) or owned only (private filter)
+ /// Required roles: BizAdminFull
///
///
- ///
+ ///
///
///
- [HttpPut("{id}")]
- public async Task PutFormCustom([FromRoute] long id, [FromBody] FormCustom inObj)
+ [HttpPut("{formkey}")]
+ public async Task PutFormCustom([FromRoute] string formkey, [FromBody] FormCustom inObj)
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
@@ -150,7 +149,7 @@ namespace AyaNova.Api.Controllers
//Instantiate the business object handler
FormCustomBiz biz = FormCustomBiz.GetBiz(ct, HttpContext);
- var o = await biz.GetNoLogAsync(id);
+ var o = await biz.GetNoLogAsync(formkey);
if (o == null)
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
@@ -164,7 +163,7 @@ namespace AyaNova.Api.Controllers
}
catch (DbUpdateConcurrencyException)
{
- if (!await biz.ExistsAsync(id))
+ if (!await biz.ExistsAsync(formkey))
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
else
return StatusCode(409, new ApiErrorResponse(ApiErrorCode.CONCURRENCY_CONFLICT));
diff --git a/server/AyaNova/biz/FormCustomBiz.cs b/server/AyaNova/biz/FormCustomBiz.cs
index 1c7c1c2f..17c18167 100644
--- a/server/AyaNova/biz/FormCustomBiz.cs
+++ b/server/AyaNova/biz/FormCustomBiz.cs
@@ -37,17 +37,17 @@ namespace AyaNova.Biz
////////////////////////////////////////////////////////////////////////////////////////////////
//EXISTS
- internal async Task ExistsAsync(long id)
+ internal async Task ExistsAsync(string formKey)
{
- return await ct.FormCustom.AnyAsync(e => e.Id == id);
+ return await ct.FormCustom.AnyAsync(x => x.FormKey == formKey);
}
////////////////////////////////////////////////////////////////////////////////////////////////
/// GET
- internal async Task GetNoLogAsync(long fetchId)
+ internal async Task GetNoLogAsync(string formKey)
{
//This is simple so nothing more here, but often will be copying to a different output object or some other ops
- return await ct.FormCustom.SingleOrDefaultAsync(m => m.Id == fetchId);
+ return await ct.FormCustom.SingleOrDefaultAsync(x => x.FormKey == formKey);
}
////////////////////////////////////////////////////////////////////////////////////////////////