-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(post/edit): Fix various validation issues
- In NotificationBase.cs, fixed the initialization of EmittedAt property to use DateTimeOffset.UtcNow instead of DateTime.UtcNow. - In PostModAction.cs, removed redundant empty lines. - In ReplayChatMessageDTO.cs, marked PlayerId, Username, MessageGroup, and MessageContent properties as nullable to disable API validation. - In ReplayDTO.cs, initialized DownloadUri with an empty string and Players and ChatMessages properties with empty arrays.
- Loading branch information
1 parent
2a44118
commit 10129fe
Showing
5 changed files
with
14 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
WowsKarma.Common/Models/DTOs/Replays/ReplayChatMessageDTO.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
namespace WowsKarma.Common.Models.DTOs.Replays; | ||
|
||
/// <remarks> | ||
/// HACK: Fields are set as nullable to disable API validation. | ||
/// </remarks> | ||
public struct ReplayChatMessageDTO | ||
{ | ||
public uint PlayerId { get; init; } | ||
public string Username { get; init; } | ||
public uint? PlayerId { get; init; } | ||
public string? Username { get; init; } | ||
|
||
public string MessageGroup { get; init; } | ||
public string? MessageGroup { get; init; } | ||
|
||
public string MessageContent { get; init; } | ||
public string? MessageContent { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
namespace WowsKarma.Common.Models.DTOs.Replays; | ||
|
||
public record ReplayDTO | ||
public sealed record ReplayDTO | ||
{ | ||
public Guid Id { get; init; } | ||
|
||
public Guid PostId { get; init; } | ||
|
||
public string DownloadUri { get; init; } | ||
public string DownloadUri { get; init; } = ""; | ||
|
||
public string? MinimapUri { get; init; } | ||
|
||
public IEnumerable<ReplayPlayerDTO> Players { get; set; } | ||
public IEnumerable<ReplayPlayerDTO> Players { get; set; } = []; | ||
|
||
public IEnumerable<ReplayChatMessageDTO> ChatMessages { get; set; } | ||
public IEnumerable<ReplayChatMessageDTO> ChatMessages { get; set; } = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters