Skip to content

Commit

Permalink
Uniformize LiveFeed responses (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMacocian authored Nov 26, 2023
1 parent 755e4ed commit edffb7d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions GuildWarsPartySearch/Services/Feed/LiveFeedService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using GuildWarsPartySearch.Server.Models.Endpoints;
using Newtonsoft.Json;
using System.Core.Extensions;
using System.Net.WebSockets;
using System.Text;
Expand All @@ -24,7 +25,8 @@ public void AddClient(WebSocket client)

public async Task PushUpdate(Models.PartySearch partySearchUpdate, CancellationToken cancellationToken)
{
var payloadString = JsonConvert.SerializeObject(partySearchUpdate);
// Since LiveFeed endpoint expects a PartySearchList, so we send a PartySearchList with only the update to keep it consistent
var payloadString = JsonConvert.SerializeObject(new PartySearchList { Searches = [ partySearchUpdate ] });
var payload = Encoding.UTF8.GetBytes(payloadString);
await ExecuteOnClientsInternal(async client =>
{
Expand Down

0 comments on commit edffb7d

Please sign in to comment.