Skip to content

Commit

Permalink
hoping to fix the updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-zhur committed Aug 17, 2024
1 parent 89b483b commit f717e72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Net;
using System.Text.Json;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using OneShelf.Telegram.Processor.Model;
using OneShelf.Telegram.Processor.Services;
using Telegram.BotAPI.GettingUpdates;
Expand Down Expand Up @@ -41,7 +41,7 @@ public async Task RegenerationsQueueTrigger(
public async Task UpdatesQueueTrigger(
[QueueTrigger(QueueNameUpdates)] string myQueueItem)
{
var update = JsonConvert.DeserializeObject<Update>(myQueueItem) ?? throw new("Empty request body.");
var update = JsonSerializer.Deserialize<Update>(myQueueItem) ?? throw new("Empty request body.");
await await _pipeline.ProcessSyncSafeAndDispose(update, null);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Net;
using System.Text.Json;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using OneShelf.Common.Database.Songs;
using OneShelf.Telegram.Processor.Model;
using Telegram.BotAPI;
Expand Down Expand Up @@ -102,7 +102,7 @@ public async Task<HttpResponseData> GetWebHook([HttpTrigger(AuthorizationLevel.A
var response = req.CreateResponse(HttpStatusCode.OK);
response.Headers.Add("Content-Type", "text/plain; charset=utf-8");

await response.WriteStringAsync(JsonConvert.SerializeObject(await _api.GetWebhookInfoAsync()));
await response.WriteStringAsync(JsonSerializer.Serialize(await _api.GetWebhookInfoAsync()));

return response;
}
Expand Down

0 comments on commit f717e72

Please sign in to comment.