1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

fix aliases for real (hopefully)

fix bug with flag not being applied
fix level being set based on IP instead of IP and name
This commit is contained in:
RaidMax
2018-12-31 20:52:19 -06:00
parent dd31f30876
commit 5a1525835a
6 changed files with 86 additions and 41 deletions

View File

@ -55,7 +55,7 @@ namespace SharedLibraryCore.Services
{
await context.Clients
.Include(c => c.ReceivedPenalties)
.Where(c => c.AliasLinkId == newEntity.LinkId)
.Where(c => c.AliasLinkId == newEntity.Link.AliasLinkId)
.ForEachAsync(c =>
{
if (c.Level != Permission.Flagged)
@ -81,7 +81,7 @@ namespace SharedLibraryCore.Services
// we just want to add it to the database
else
{
context.Penalties.Add(new EFPenalty()
var penalty = new EFPenalty()
{
Active = true,
OffenderId = newEntity.Offender.ClientId,
@ -93,7 +93,10 @@ namespace SharedLibraryCore.Services
When = DateTime.UtcNow,
AutomatedOffense = newEntity.AutomatedOffense,
IsEvadedOffense = newEntity.IsEvadedOffense
});
};
newEntity.Offender.ReceivedPenalties.Add(penalty);
context.Penalties.Add(penalty);
}
await context.SaveChangesAsync();