Merge branch 'main' into recent-activity

# Conflicts:
#	.config/dotnet-tools.json
#	ProjectLighthouse.Servers.Website/Pages/Partials/ReviewPartial.cshtml
This commit is contained in:
Slendy 2024-04-01 14:45:59 -05:00
commit 8f91875f7c
No known key found for this signature in database
GPG key ID: 7288D68361B91428
54 changed files with 459 additions and 48 deletions

View file

@ -133,6 +133,9 @@ public class CommentController : ControllerBase
{
GameTokenEntity token = this.GetToken();
// Deny request if in read-only mode
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest();
GameComment? comment = await this.DeserializeBody<GameComment>();
if (comment?.Message == null) return this.BadRequest();
@ -173,6 +176,9 @@ public class CommentController : ControllerBase
{
GameTokenEntity token = this.GetToken();
// Deny request if in read-only mode
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest();
if ((slotId == 0 || SlotHelper.IsTypeInvalid(slotType)) == (username == null)) return this.BadRequest();
CommentEntity? comment = await this.database.Comments.FirstOrDefaultAsync(c => c.CommentId == commentId);