This commit is contained in:
2020-12-08 19:02:53 +00:00
parent 12f097d1a1
commit 44901b32e6

View File

@@ -14,7 +14,7 @@ namespace AyaNova.Biz
{
internal class UserBiz : BizObject, IJobObject, ISearchAbleObject, IReportAbleObject
internal class UserBiz : BizObject, IJobObject, ISearchAbleObject, IReportAbleObject//, IExportAbleObject, IImportAbleObject
{
@@ -448,11 +448,12 @@ namespace AyaNova.Biz
try
{
User dbObject = await ct.User.SingleOrDefaultAsync(z => z.Id == id);
if (dbObject == null){
if (dbObject == null)
{
AddError(ApiErrorCode.NOT_FOUND);
return false;
}
//Also used for Contacts (customer type user or ho type user)
//by users with no User right but with Customer rights so need to double check here
@@ -797,7 +798,10 @@ namespace AyaNova.Biz
{
SaveIt = false;
ClearErrors();
var o = await GetAsync(id, false);
//a little different than normal here because the built in getasync doesn't return
//a full User object normally
// var o = await GetAsync(id, false);
var o = await ct.User.SingleOrDefaultAsync(z => z.Id == id);
switch (job.SubType)
{
case JobSubType.TagAddAny:
@@ -814,10 +818,9 @@ namespace AyaNova.Biz
if (SaveIt)
{
User u = new User();
CopyObject.Copy(o, u, "Id, Salt, CurrentAuthToken, DlKey, DlKeyExpire");
u = await PutAsync(u);
if (u == null)
o = await PutAsync(o);
if (o == null)
await JobsBiz.LogJobAsync(job.GId, $"Error processing item {id}: {GetErrorsAsString()}");
else
ChangedObjectCount++;