This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -53,7 +53,7 @@
|
|||||||
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
||||||
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
||||||
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
||||||
"AYANOVA_SERVER_TEST_MODE": "true",
|
"AYANOVA_SERVER_TEST_MODE": "false",
|
||||||
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
||||||
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
||||||
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
||||||
|
|||||||
@@ -307,13 +307,17 @@ namespace AyaNova.Api.Controllers
|
|||||||
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.Customer))
|
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.Customer))
|
||||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||||
|
|
||||||
var ret = await ct.User.Where(z => z.UserType == UserType.Customer || z.UserType == UserType.HeadOffice).Select(z => new dtUser
|
var ret = await ct.User.Include(o => o.UserOptions).Where(z => z.UserType == UserType.Customer || z.UserType == UserType.HeadOffice).Select(z => new
|
||||||
{
|
{
|
||||||
Id = z.Id,
|
Id = z.Id,
|
||||||
Active = z.Active,
|
Active = z.Active,
|
||||||
Name = z.Name,
|
Name = z.Name,
|
||||||
UserType = z.UserType,
|
UserType = z.UserType,
|
||||||
LastLogin = z.LastLogin
|
LastLogin = z.LastLogin,
|
||||||
|
EmailAddress = z.UserOptions.EmailAddress,
|
||||||
|
Phone1 = z.UserOptions.Phone1,
|
||||||
|
Phone2 = z.UserOptions.Phone2,
|
||||||
|
Phone3 = z.UserOptions.Phone3
|
||||||
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
return Ok(ApiOkResponse.Response(ret));
|
return Ok(ApiOkResponse.Response(ret));
|
||||||
@@ -333,13 +337,17 @@ namespace AyaNova.Api.Controllers
|
|||||||
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.Customer))
|
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.Customer))
|
||||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||||
|
|
||||||
var ret = await ct.User.Where(z => z.UserType == UserType.Customer && z.CustomerId==customerId).Select(z => new dtUser
|
var ret = await ct.User.Include(o => o.UserOptions).Where(z => z.UserType == UserType.Customer && z.CustomerId == customerId).Select(z => new
|
||||||
{
|
{
|
||||||
Id = z.Id,
|
Id = z.Id,
|
||||||
Active = z.Active,
|
Active = z.Active,
|
||||||
Name = z.Name,
|
Name = z.Name,
|
||||||
UserType = z.UserType,
|
UserType = z.UserType,
|
||||||
LastLogin = z.LastLogin
|
LastLogin = z.LastLogin,
|
||||||
|
EmailAddress = z.UserOptions.EmailAddress,
|
||||||
|
Phone1 = z.UserOptions.Phone1,
|
||||||
|
Phone2 = z.UserOptions.Phone2,
|
||||||
|
Phone3 = z.UserOptions.Phone3
|
||||||
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
return Ok(ApiOkResponse.Response(ret));
|
return Ok(ApiOkResponse.Response(ret));
|
||||||
|
|||||||
@@ -348,9 +348,7 @@ namespace AyaNova.Biz
|
|||||||
await ValidateCanDelete(dbObject);
|
await ValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
return false;
|
return false;
|
||||||
//Remove the object
|
|
||||||
ct.User.Remove(dbObject);
|
|
||||||
await ct.SaveChangesAsync();
|
|
||||||
//Delete sibling objects
|
//Delete sibling objects
|
||||||
//USEROPTIONS
|
//USEROPTIONS
|
||||||
await ct.Database.ExecuteSqlInterpolatedAsync($"delete from auseroptions where userid = {dbObject.Id}");
|
await ct.Database.ExecuteSqlInterpolatedAsync($"delete from auseroptions where userid = {dbObject.Id}");
|
||||||
@@ -365,6 +363,11 @@ namespace AyaNova.Biz
|
|||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
||||||
await TagBiz.ProcessDeleteTagsInRepositoryAsync(ct, dbObject.Tags);
|
await TagBiz.ProcessDeleteTagsInRepositoryAsync(ct, dbObject.Tags);
|
||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
|
|
||||||
|
//Remove the object
|
||||||
|
ct.User.Remove(dbObject);
|
||||||
|
await ct.SaveChangesAsync();
|
||||||
|
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await NotifyEventProcessor.HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await NotifyEventProcessor.HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -631,7 +631,7 @@ namespace AyaNova.Util
|
|||||||
u.UserOptions.EmailAddress = Fake.Internet.ExampleEmail();
|
u.UserOptions.EmailAddress = Fake.Internet.ExampleEmail();
|
||||||
u.UserOptions.Hour12 = true;
|
u.UserOptions.Hour12 = true;
|
||||||
u.UserOptions.CurrencyName = "USD";
|
u.UserOptions.CurrencyName = "USD";
|
||||||
u.UserOptions.UiColor = Fake.Internet.Color();
|
u.UserOptions.UiColor = Fake.Internet.Color().ToUpperInvariant();
|
||||||
|
|
||||||
|
|
||||||
//this seems wrong to get a new context inside a loop but in testing is actually faster!?
|
//this seems wrong to get a new context inside a loop but in testing is actually faster!?
|
||||||
|
|||||||
Reference in New Issue
Block a user