diff --git a/devdocs/todo.txt b/devdocs/todo.txt index 31558d10..c272c067 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -36,7 +36,7 @@ TEST CHANGES TODO: REFACTOR GetNoLogAsync function is used in many places redundantly when the logging version could do the same thing but not log it with an optional bool switch so refactor that shit - +TODO: REFACTOR biz objects have two creates, an async and sync one, WTF is that about? See if can make it just one async version. DO CLIENT STUFF NOW COME BACK TO THIS STUFF LATER diff --git a/server/AyaNova/Controllers/DataListTemplateController.cs b/server/AyaNova/Controllers/DataListTemplateController.cs index 3b0a16c6..ca3ca325 100644 --- a/server/AyaNova/Controllers/DataListTemplateController.cs +++ b/server/AyaNova/Controllers/DataListTemplateController.cs @@ -1,10 +1,8 @@ -using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.JsonPatch; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; diff --git a/server/AyaNova/biz/DataListTemplateBiz.cs b/server/AyaNova/biz/DataListTemplateBiz.cs index 56264bf6..f2a0dab7 100644 --- a/server/AyaNova/biz/DataListTemplateBiz.cs +++ b/server/AyaNova/biz/DataListTemplateBiz.cs @@ -113,6 +113,11 @@ namespace AyaNova.Biz { //DataListKey always exists, if not in db then in default form var ret = await ct.DataListTemplate.SingleOrDefaultAsync(m => m.DataListKey == DataListKey); + //Not in db? then put it in the db with the default then return it + if (ret == null) + { + + } if (log) { @@ -123,47 +128,14 @@ namespace AyaNova.Biz } - // //////////////////////////////////////////////////////////////////////////////////////////////// - // /// GET - // internal async Task GetNoLogAsync(long fetchId) - // { - // //This is simple so nothing more here, but often will be copying to a different output object or some other ops - // return await ct.DataListTemplate.SingleOrDefaultAsync(m => m.Id == fetchId); - // } - - // //get picklist (NOT PAGED) - // internal async Task> GetPickListAsync(string listKey) - // { - // List items = new List(); - // if (!string.IsNullOrWhiteSpace(listKey)) - // { - // items = await ct.DataListTemplate - // .AsNoTracking() - // .Where(m => m.ListKey == listKey && (m.Public == true || m.UserId == UserId)) - // .OrderBy(m => m.Name) - // .Select(m => new NameIdItem() - // { - // Id = m.Id, - // Name = m.Name - // }).ToListAsync(); - - // } - // return items; - // } - - - //////////////////////////////////////////////////////////////////////////////////////////////// //UPDATE // //put - internal bool Put(DataListTemplate dbObj, DataListTemplate inObj) + internal bool Put(DataListTemplate dbObj, DataListTemplate inObj, IAyaDataList dataList) { - //preserve the owner ID if none was specified - if (inObj.UserId == 0) - inObj.UserId = dbObj.UserId; //Replace the db object with the PUT object CopyObject.Copy(inObj, dbObj, "Id"); @@ -178,8 +150,6 @@ namespace AyaNova.Biz //Log modification EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct); - //Update keywords - // Search.ProcessUpdatedObjectKeywords(UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Name); return true; }