diff --git a/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs b/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs index be7acb64..46189c2c 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/SlotPageController.cs @@ -65,7 +65,7 @@ public class SlotPageController : ControllerBase if (msg == null) { - Logger.Error($"Refusing to post comment from {token.UserId} on user {id}, {nameof(msg)} is null", LogArea.Comments); + Logger.Error($"Refusing to post comment from {token.UserId} on level {id}, {nameof(msg)} is null", LogArea.Comments); return this.Redirect("~/slot/" + id); } @@ -73,8 +73,15 @@ public class SlotPageController : ControllerBase msg = SanitizationHelper.SanitizeString(msg); msg = CensorHelper.FilterMessage(msg); - await this.database.PostComment(token.UserId, id, CommentType.Level, msg); - Logger.Success($"Posted comment from {token.UserId}: \"{msg}\" on user {id}", LogArea.Comments); + bool success = await this.database.PostComment(token.UserId, id, CommentType.Level, msg); + if (success) + { + Logger.Success($"Posted comment from {token.UserId}: \"{msg}\" on level {id}", LogArea.Comments); + } + else + { + Logger.Error($"Failed to post comment from {token.UserId}: \"{msg}\" on level {id}", LogArea.Comments); + } return this.Redirect("~/slot/" + id); } diff --git a/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs b/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs index b05bc07b..e7e1cfb1 100644 --- a/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs +++ b/ProjectLighthouse.Servers.Website/Controllers/UserPageController.cs @@ -47,8 +47,15 @@ public class UserPageController : ControllerBase msg = SanitizationHelper.SanitizeString(msg); msg = CensorHelper.FilterMessage(msg); - await this.database.PostComment(token.UserId, id, CommentType.Profile, msg); - Logger.Success($"Posted comment from {token.UserId}: \"{msg}\" on user {id}", LogArea.Comments); + bool success = await this.database.PostComment(token.UserId, id, CommentType.Profile, msg); + if (success) + { + Logger.Success($"Posted comment from {token.UserId}: \"{msg}\" on user {id}", LogArea.Comments); + } + else + { + Logger.Error($"Failed to post comment from {token.UserId}: \"{msg}\" on user {id}", LogArea.Comments); + } return this.Redirect("~/user/" + id); }