Skip to content

Commit

Permalink
🎨 Style: trailing commas, trailing commas EVERYWHERE!
Browse files Browse the repository at this point in the history
  • Loading branch information
Atulin committed Aug 26, 2024
1 parent e7153d5 commit 0a0ca79
Show file tree
Hide file tree
Showing 91 changed files with 145 additions and 144 deletions.
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/ClubJoin/Commands/JoinClub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async ValueTask<ActionResult<bool>> Handle(Command request, CancellationT
{
ClubId = request.ClubId,
MemberId = uid,
Role = EClubMemberRoles.User
Role = EClubMemberRoles.User,
});

await _context.SaveChangesAsync(cancellationToken);
Expand Down
4 changes: 2 additions & 2 deletions Ogma3/Api/V1/Clubs/Commands/BanUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public async ValueTask<ActionResult<bool>> Handle(Command request, CancellationT
ClubId = clubId,
UserId = userId,
IssuerId = uid,
Reason = reason
Reason = reason,
});
var result = await context.SaveChangesAsync(cancellationToken);

Expand All @@ -72,7 +72,7 @@ public async ValueTask<ActionResult<bool>> Handle(Command request, CancellationT
{
ClubId = clubId,
ModeratorId = uid,
Description = ModeratorActionTemplates.UserBan(user.UserName, issuer.UserName, reason)
Description = ModeratorActionTemplates.UserBan(user.UserName, issuer.UserName, reason),
});
await context.SaveChangesAsync(cancellationToken);

Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Clubs/Commands/UnbanUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public async ValueTask<ActionResult<bool>> Handle(Command request, CancellationT
{
ClubId = clubId,
ModeratorId = uid,
Description = ModeratorActionTemplates.UserUnban(user.UserName, issuer.UserName)
Description = ModeratorActionTemplates.UserUnban(user.UserName, issuer.UserName),
});
await context.SaveChangesAsync(cancellationToken);

Expand Down
4 changes: 2 additions & 2 deletions Ogma3/Api/V1/CommentThreads/Commands/LockThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public async ValueTask<ActionResult<bool>> Handle(Command request, CancellationT
_context.ModeratorActions.Add(new ModeratorAction
{
StaffMemberId = uid,
Description = message
Description = message,
});
}
else if (permission.IsClubModerator && thread.ClubThreadId is not null)
Expand All @@ -81,7 +81,7 @@ public async ValueTask<ActionResult<bool>> Handle(Command request, CancellationT
{
ModeratorId = uid,
ClubId = clubId,
Description = message
Description = message,
});
}
else
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Comments/Commands/CreateChapterComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public async ValueTask<ActionResult<CommentDto>> Handle(Command request, Cancell
{
AuthorId = (long)_uid,
Body = body,
CommentsThreadId = threadId
CommentsThreadId = threadId,
};

_context.Comments.Add(comment);
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Comments/Commands/CreateClubThreadComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async ValueTask<ActionResult<CommentDto>> Handle(Command request, Cancell
{
AuthorId = (long)_uid,
Body = body,
CommentsThreadId = threadId
CommentsThreadId = threadId,
};

_context.Comments.Add(comment);
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Comments/Commands/CreateProfileComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public async ValueTask<ActionResult<CommentDto>> Handle(Command request, Cancell
{
AuthorId = (long)_uid,
Body = body,
CommentsThreadId = threadId
CommentsThreadId = threadId,
};

_context.Comments.Add(comment);
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Comments/Commands/UpdateComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async ValueTask<ActionResult<CommentDto>> Handle(Command request, Cancell
_context.CommentRevisions.Add(new CommentRevision
{
Body = comm.Body,
ParentId = comm.Id
ParentId = comm.Id,
});

// Edit the comment
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Comments/CommentsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task<ActionResult<string>> GetMarkdown([FromQuery] GetCommentMarkdo
nameof(OgmaUser) => await PostProfileComment(data),
nameof(Blogpost) => await PostBlogpostComment(data),
nameof(ClubThread) => await PostClubThreadComment(data),
_ => throw new ArgumentOutOfRangeException(nameof(data), $"Was {data.Type}")
_ => throw new ArgumentOutOfRangeException(nameof(data), $"Was {data.Type}"),
};

private async Task<ActionResult<CommentDto>> PostChapterComment(PostData data)
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Comments/Queries/GetPaginatedComments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public async ValueTask<ActionResult<PaginationResult<CommentDto>>> Handle(Query
Total = total,
Page = p,
Pages = (int)Math.Ceiling((double)total / _ogmaConfig.CommentsPerPage),
PerPage = _ogmaConfig.CommentsPerPage
PerPage = _ogmaConfig.CommentsPerPage,
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/ErrorController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public ActionResult<Result> OnGet([FromQuery] int? code)
: "Unknown Error";
return new JsonResult(new Result(code, text))
{
StatusCode = code ?? 0
StatusCode = code ?? 0,
};
}

Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Folders/Commands/AddStoryToFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public async ValueTask<ActionResult<Response>> Handle(Command request, Cancellat
{
FolderId = folderId,
StoryId = storyId,
AddedById = uid
AddedById = uid,
});
folder.StoriesCount++;

Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Ratings/Commands/CreateRating.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async ValueTask<ActionResult<RatingApiDto>> Handle(Command request, Cance
Name = name,
Description = description,
BlacklistedByDefault = blacklistedByDefault,
Order = order
Order = order,
};

if (formFile is { Length: > 0 })
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Reports/Commands/ReportContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async ValueTask<ActionResult<long>> Handle(Command request, CancellationT
{
Reason = reason,
ReporterId = uid,
ContentType = itemType.ToString()
ContentType = itemType.ToString(),
};

switch (itemType)
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Roles/Commands/CreateRole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async ValueTask<ActionResult<RoleDto>> Handle(Command request, Cancellati
Name = name,
IsStaff = isStaff,
Color = color,
Order = order
Order = order,
};

await _roleManager.CreateAsync(role);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public async ValueTask<ActionResult<bool>> Handle(Command request, CancellationT
_context.CommentsThreadSubscribers.Add(new CommentsThreadSubscriber
{
OgmaUserId = (long)_uid,
CommentsThreadId = request.ThreadId
CommentsThreadId = request.ThreadId,
});

await _context.SaveChangesAsync(cancellationToken);
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Tags/Commands/CreateTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public async ValueTask<ActionResult> Handle(Command request, CancellationToken c
{
Name = name,
Description = description,
Namespace = ns
Namespace = ns,
});
await _context.SaveChangesAsync(cancellationToken);

Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Api/V1/Users/UpdateRoles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ CancellationToken cancellationToken
context.ModeratorActions.AddRange(removedRoles.Select(r => new ModeratorAction
{
StaffMemberId = uid,
Description = ModeratorActionTemplates.UserRoleRemoved(user, username, r.Name)
Description = ModeratorActionTemplates.UserRoleRemoved(user, username, r.Name),
}));

// Handle role adding
Expand Down
24 changes: 12 additions & 12 deletions Ogma3/Areas/Admin/Pages/ContentBlock.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public async Task<ActionResult> OnGet(ItemType type, long id)
Blocked = s.ContentBlockId != null,
Reason = s.ContentBlock == null ? null : s.ContentBlock.Reason,
Title = s.Title,
Type = nameof(Story)
Type = nameof(Story),
})
.FirstOrDefaultAsync(),
ItemType.Chapter => await _context.Chapters.Where(c => c.Id == id)
Expand All @@ -48,7 +48,7 @@ public async Task<ActionResult> OnGet(ItemType type, long id)
Reason = c.ContentBlock == null ? null : c.ContentBlock.Reason,
Title = c.Title,
Subtitle = c.Story.Title,
Type = nameof(Chapter)
Type = nameof(Chapter),
})
.FirstOrDefaultAsync(),
ItemType.Blogpost => await _context.Blogposts.Where(b => b.Id == id)
Expand All @@ -57,10 +57,10 @@ public async Task<ActionResult> OnGet(ItemType type, long id)
Blocked = b.ContentBlockId != null,
Reason = b.ContentBlock == null ? null : b.ContentBlock.Reason,
Title = b.Title,
Type = nameof(Blogpost)
Type = nameof(Blogpost),
})
.FirstOrDefaultAsync(),
_ => null
_ => null,
};

return Page();
Expand All @@ -80,7 +80,7 @@ public async Task<ActionResult> OnPostBlock([FromForm] PostData data)
ItemType.Story => await TryBlockContent<Story>(Id, data.Reason, staffId),
ItemType.Chapter => await TryBlockContent<Chapter>(Id, data.Reason, staffId),
ItemType.Blogpost => await TryBlockContent<Blogpost>(Id, data.Reason, staffId),
_ => false
_ => false,
};

return RedirectToPage("./ContentBlock", new { type = Type, id = Id });
Expand All @@ -102,7 +102,7 @@ private async Task<bool> TryBlockContent<T>(long itemId, string reason, long uid
Story s => s.Title,
Chapter c => c.Title,
Blogpost b => b.Title,
_ => ""
_ => "",
};

if (item.ContentBlock is not null) return true;
Expand All @@ -111,14 +111,14 @@ private async Task<bool> TryBlockContent<T>(long itemId, string reason, long uid
{
Reason = reason,
IssuerId = uid,
Type = typeof(T).Name
Type = typeof(T).Name,
};

// Log the action
_context.ModeratorActions.Add(new ModeratorAction
{
StaffMemberId = staffId,
Description = ModeratorActionTemplates.ContentBlocked(Type.ToString(), title, itemId, uname)
Description = ModeratorActionTemplates.ContentBlocked(Type.ToString(), title, itemId, uname),
});

await _context.SaveChangesAsync();
Expand All @@ -132,7 +132,7 @@ public async Task<ActionResult> OnPostUnblock()
ItemType.Story => await TryUnblockContent<Story>(Id),
ItemType.Chapter => await TryUnblockContent<Chapter>(Id),
ItemType.Blogpost => await TryUnblockContent<Blogpost>(Id),
_ => false
_ => false,
};

return RedirectToPage("./ContentBlock", new { type = Type, id = Id });
Expand All @@ -154,7 +154,7 @@ private async Task<bool> TryUnblockContent<T>(long itemId) where T : BaseModel,
Story s => s.Title,
Chapter c => c.Title,
Blogpost b => b.Title,
_ => ""
_ => "",
};

if (item.ContentBlock is null) return true;
Expand All @@ -165,7 +165,7 @@ private async Task<bool> TryUnblockContent<T>(long itemId) where T : BaseModel,
_context.ModeratorActions.Add(new ModeratorAction
{
StaffMemberId = staffId,
Description = ModeratorActionTemplates.ContentUnblocked(Type.ToString(), title, itemId, uname)
Description = ModeratorActionTemplates.ContentUnblocked(Type.ToString(), title, itemId, uname),
});

await _context.SaveChangesAsync();
Expand All @@ -176,7 +176,7 @@ public enum ItemType
{
Blogpost,
Story,
Chapter
Chapter,
}

public sealed record PostData(string Reason = "");
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Areas/Admin/Pages/Documents/Create.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public async Task<IActionResult> OnPostAsync()
Body = Input.Body,
Version = 1,
CreationTime = now,
RevisionDate = null
RevisionDate = null,
});

await _context.SaveChangesAsync();
Expand Down
4 changes: 2 additions & 2 deletions Ogma3/Areas/Admin/Pages/Documents/Edit.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task<IActionResult> OnGetAsync(string slug)
Slug = d.Slug,
Title = d.Title,
Body = d.Body,
Version = d.Version
Version = d.Version,
})
.FirstOrDefaultAsync();

Expand Down Expand Up @@ -70,7 +70,7 @@ public async Task<IActionResult> OnPostAsync()
Body = string.IsNullOrEmpty(Input.Body) ? oldVersion.Body : Input.Body,
Version = oldVersion.Version + 1,
CreationTime = now,
RevisionDate = null
RevisionDate = null,
});

oldVersion.RevisionDate = now;
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Areas/Admin/Pages/ModLog.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task OnGet([FromQuery] int page = 1)
{
PerPage = PerPage,
CurrentPage = page,
ItemCount = count
ItemCount = count,
};
}
}
2 changes: 1 addition & 1 deletion Ogma3/Areas/Admin/Pages/Reports.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task OnGetAsync([FromQuery] int page = 1)
{
CurrentPage = page,
ItemCount = count,
PerPage = PerPage
PerPage = PerPage,
};
}

Expand Down
4 changes: 2 additions & 2 deletions Ogma3/Areas/Admin/Pages/Users.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public async Task<ActionResult> OnGet([FromQuery] string? name)
ActiveUntil = i.ActiveUntil,
IssueDate = i.IssueDate,
RemovedAt = i.RemovedAt,
RemovedBy = i.RemovedBy != null ? i.RemovedBy.UserName : null
RemovedBy = i.RemovedBy != null ? i.RemovedBy.UserName : null,
})
.ToList()
.ToList(),
})
.FirstOrDefaultAsync();

Expand Down
8 changes: 4 additions & 4 deletions Ogma3/Areas/Identity/Pages/Account/ConfirmEmail.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public async Task<IActionResult> OnPostAsync()
var blockedRatings = defaultBlockedRatings.Select(dbr => new BlacklistedRating
{
User = user,
RatingId = dbr
RatingId = dbr,
});
_context.BlacklistedRatings.AddRange(blockedRatings);

Expand All @@ -75,7 +75,7 @@ public async Task<IActionResult> OnPostAsync()
_context.CommentsThreadSubscribers.Add(new CommentsThreadSubscriber
{
CommentsThread = thread,
OgmaUser = user
OgmaUser = user,
});

// Setup default bookshelves
Expand All @@ -91,7 +91,7 @@ public async Task<IActionResult> OnPostAsync()
TrackUpdates = true,
IsQuickAdd = true,
OwnerId = user.Id,
IconId = 12
IconId = 12,
},
new()
{
Expand All @@ -103,7 +103,7 @@ public async Task<IActionResult> OnPostAsync()
TrackUpdates = true,
IsQuickAdd = true,
OwnerId = user.Id,
IconId = 22
IconId = 22,
},
};
_context.Shelves.AddRange(shelves);
Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Areas/Identity/Pages/Account/ExternalLogin.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public async Task<IActionResult> OnGetCallbackAsync(string? returnUrl = null, st
{
Input = new InputModel
{
Email = email
Email = email,
};
}

Expand Down
2 changes: 1 addition & 1 deletion Ogma3/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public InputModelValidation()
{
Title = u.Title,
Bio = u.Bio,
Links = string.Join('\n', u.Links)
Links = string.Join('\n', u.Links),
})
.FirstOrDefaultAsync();
}
Expand Down
Loading

0 comments on commit 0a0ca79

Please sign in to comment.