Skip to content

Commit

Permalink
fix(post): Fix missing CS Ticket ID attribution
Browse files Browse the repository at this point in the history
The code changes in this commit fix an issue where the support ticket ID was not being attributed correctly to a post. The commit adds logic to retrieve the ticket ID from the form controls and assigns it to the post's supportTicketStatus property. This ensures that the post is associated with the correct support ticket.
  • Loading branch information
SakuraIsayeki committed Sep 1, 2024
1 parent 2d228ab commit 706c47c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions WowsKarma.Api/Services/Posts/PostService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public async Task EditPostAsync(Guid id, PlayerPostDTO edited, bool modEditLock
current.Flairs = edited.Flairs;
current.UpdatedAt = DateTimeOffset.UtcNow; // Forcing UpdatedAt refresh
current.ReadOnly = current.ReadOnly || modEditLock;
current.CustomerSupportTicketId = edited.SupportTicketStatus.TicketId;

KarmaService.UpdatePlayerKarma(player, current.ParsedFlairs, previousFlairs, current.NegativeKarmaAble);
KarmaService.UpdatePlayerRatings(player, current.ParsedFlairs, previousFlairs);
Expand Down
2 changes: 1 addition & 1 deletion WowsKarma.Common/Models/DTOs/PlayerPostDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public record PlayerPostDTO
/// <summary>
/// Defines the status of the Customer Support ticket associated with the post when applicable.
/// </summary>
public struct CustomerSupportStatus
public readonly struct CustomerSupportStatus
{
/// <summary>
/// Whether the post has an associated Customer Support ticket.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ export class PostEditorComponent {
this.post.replayFile = this.form.controls.replayFile.value;
}

const ticketId = this.form.controls.supportTicketStatus.controls.ticketId.value;
this.post.supportTicketStatus = { hasTicket: !!ticketId, ticketId };


if (create) {
// Create the body as a form data
Expand Down

0 comments on commit 706c47c

Please sign in to comment.