bug fix: setting a profile as default for a user causes other users default profile to be removed
This commit is contained in:
parent
1456e5bb43
commit
52db1dabf0
@ -1681,7 +1681,7 @@ namespace RMuseum.Services.Implementationa
|
||||
await _context.SaveChangesAsync();
|
||||
if(p.IsDefault)
|
||||
{
|
||||
foreach(var o in _context.UserRecitationProfiles.Where(o => o.Id != p.Id && o.IsDefault).Select(o => o))
|
||||
foreach(var o in _context.UserRecitationProfiles.Where(o => o.Id != p.Id && o.UserId == p.UserId && o.IsDefault).Select(o => o))
|
||||
{
|
||||
o.IsDefault = false;
|
||||
_context.UserRecitationProfiles.Update(o);
|
||||
@ -1735,7 +1735,7 @@ namespace RMuseum.Services.Implementationa
|
||||
await _context.SaveChangesAsync();
|
||||
if (p.IsDefault)
|
||||
{
|
||||
foreach (var o in _context.UserRecitationProfiles.Where(o => o.Id != p.Id && o.IsDefault).Select(o => o))
|
||||
foreach (var o in _context.UserRecitationProfiles.Where(o => o.Id != p.Id && o.UserId == p.UserId && o.IsDefault).Select(o => o))
|
||||
{
|
||||
o.IsDefault = false;
|
||||
_context.UserRecitationProfiles.Update(o);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user