deleting the account now also updates the discord mesage

This commit is contained in:
Sarah Faey 2022-12-04 12:52:41 +01:00
parent 5d05430b89
commit 21ac2db1cd

View file

@ -119,8 +119,13 @@ namespace Lieb.Data
await context.SaveChangesAsync();
IEnumerable<RaidSignUp> signUps = context.RaidSignUps.Where(r => r.LiebUserId == userId);
HashSet<int> raidIds = signUps.Select(s => s.RaidId).ToHashSet();
context.RemoveRange(signUps);
await context.SaveChangesAsync();
foreach(int raidId in raidIds)
{
await _discordService.PostRaidMessage(raidId);
}
IEnumerable<RaidLog> logs = context.RaidLogs.Where(r => r.UserId == userId);
foreach(RaidLog log in logs)