diff --git a/.vscode/launch.json b/.vscode/launch.json
index 69b973c3..9efe9077 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -51,7 +51,7 @@
"AYANOVA_USE_URLS": "http://*:7575;",
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
- "AYANOVA_SERVER_TEST_MODE":"true",
+ "AYANOVA_SERVER_TEST_MODE":"false",
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL":"small",
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET":"-7",
"AYANOVA_BACKUP_PG_DUMP_PATH":"C:\\data\\code\\PostgreSQLPortable_12.0\\App\\PgSQL\\bin\\"
diff --git a/server/AyaNova/Controllers/FormCustomController.cs b/server/AyaNova/Controllers/FormCustomController.cs
index cee1b818..bc1e5dcb 100644
--- a/server/AyaNova/Controllers/FormCustomController.cs
+++ b/server/AyaNova/Controllers/FormCustomController.cs
@@ -179,7 +179,29 @@ namespace AyaNova.Api.Controllers
}
+ ///
+ /// Get FormKey from id of FormCustom
+ ///
+ /// A formKey string if id found
+ [HttpGet("form-key/{id}")]
+ public async Task GetFormKeyFromId(long id)
+ {
+ if (!serverState.IsOpen)
+ return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
+ if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.FormCustom))
+ return StatusCode(403, new ApiNotAuthorizedResponse());
+
+ if (!ModelState.IsValid)
+ return BadRequest(new ApiErrorResponse(ModelState));
+
+ var fc = await ct.FormCustom.FirstOrDefaultAsync(z => z.Id == id);
+ if (fc == null)
+ {
+ return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
+ }
+ return Ok(ApiOkResponse.Response(fc.FormKey));
+ }
//------------
diff --git a/server/AyaNova/models/FormCustom.cs b/server/AyaNova/models/FormCustom.cs
index b8df7046..025216f2 100644
--- a/server/AyaNova/models/FormCustom.cs
+++ b/server/AyaNova/models/FormCustom.cs
@@ -4,6 +4,7 @@ namespace AyaNova.Models
{
/*
+ ## NOTE: there is only one formcustom per ayatype, the formkey is the ayatype enum name
- Like DataFilter, holds a JSON fragment in one field and the form key in another field
- JSON FRAGMENT holds items that differ from stock, Hide not valid for non hideable core fields
@@ -16,7 +17,7 @@ namespace AyaNova.Models
*/
public class FormCustom
{
- public long Id { get; set; }
+ public long Id { get; set; }//Only one formcustom per object type
public uint Concurrency { get; set; }
[Required, MaxLength(255)]