This commit is contained in:
@@ -59,11 +59,9 @@ namespace AyaNova.Biz
|
||||
return null;
|
||||
else
|
||||
{
|
||||
//do stuff with datafilter
|
||||
//do stuff with object
|
||||
FormCustom outObj = inObj;
|
||||
outObj.OwnerId = UserId;
|
||||
|
||||
|
||||
|
||||
await ct.FormCustom.AddAsync(outObj);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
@@ -104,10 +102,7 @@ namespace AyaNova.Biz
|
||||
//put
|
||||
internal bool Put(FormCustom dbObj, FormCustom inObj)
|
||||
{
|
||||
//preserve the owner ID if none was specified
|
||||
if (inObj.OwnerId == 0)
|
||||
inObj.OwnerId = dbObj.OwnerId;
|
||||
|
||||
|
||||
//Replace the db object with the PUT object
|
||||
CopyObject.Copy(inObj, dbObj, "Id");
|
||||
//Set "original" value of concurrency token to input token
|
||||
@@ -138,17 +133,6 @@ namespace AyaNova.Biz
|
||||
private void Validate(FormCustom inObj, bool isNew)
|
||||
{
|
||||
|
||||
//OwnerId required
|
||||
if (!isNew)
|
||||
{
|
||||
if (inObj.OwnerId == 0)
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "OwnerId");
|
||||
}
|
||||
|
||||
// //Owner must be current user, there are no exceptions
|
||||
// if (inObj.OwnerId != UserId)
|
||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "OwnerId", "OwnerId must be current user Id");
|
||||
|
||||
//FormKey required and must be valid
|
||||
if (string.IsNullOrWhiteSpace(inObj.FormKey))
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "FormKey");
|
||||
|
||||
@@ -22,9 +22,6 @@ namespace AyaNova.Models
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public uint ConcurrencyToken { get; set; }
|
||||
|
||||
[Required]
|
||||
public long OwnerId { get; set; }
|
||||
|
||||
[Required, MaxLength(255)]
|
||||
public string FormKey { get; set; }//max 255 characters ascii set
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace AyaNova.Util
|
||||
{
|
||||
LogUpdateMessage(log);
|
||||
|
||||
exec("CREATE TABLE aformcustom (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, " +
|
||||
exec("CREATE TABLE aformcustom (id BIGSERIAL PRIMARY KEY, " +
|
||||
"formkey varchar(255) not null, template text, UNIQUE(formkey))");
|
||||
setSchemaLevel(++currentSchema);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user