Skip to content

Commit

Permalink
Update ProjectLighthouse.Servers.Website/Controllers/Admin/AdminUserC…
Browse files Browse the repository at this point in the history
…ontroller.cs


Suggestion provided to add logging, a return, and sending a notification to the affected user

Co-authored-by: Josh <josh@slendy.pw>
  • Loading branch information
FeTetra and Slendy authored Sep 2, 2024
1 parent ba1ea9c commit d09a7f9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ public async Task<IActionResult> WipeAvatar([FromRoute] int id)
if (targetedUser == null) return this.NotFound();

targetedUser.IconHash = "";

await this.database.SaveChangesAsync();
Logger.Success($"Reset profile picture for {targetedUser.Username} (id:{targetedUser.UserId})", LogArea.Admin);

await this.database.SendNotification(targetedUser.UserId, "Your profile picture has been reset by a moderator.");

return this.Redirect($"/user/{targetedUser.UserId}");
}

/// <summary>
Expand Down

0 comments on commit d09a7f9

Please sign in to comment.