diff --git a/telegram/Sources/LandinhoBot/APIClient/APIClient.swift b/telegram/Sources/LandinhoBot/APIClient/APIClient.swift index 93bf9a0..4be2a36 100644 --- a/telegram/Sources/LandinhoBot/APIClient/APIClient.swift +++ b/telegram/Sources/LandinhoBot/APIClient/APIClient.swift @@ -36,10 +36,10 @@ struct APIClient { decoder.dateDecodingStrategy = .iso8601 do { - let response = try decoder.decode(T.self, from: data.0) + let response = try decoder.decode(T.self, from: data) return response } catch (let error) { - let result = String(data: data.0, encoding: .utf8) ?? "Couldn't decode JSON" + let result = String(data: data, encoding: .utf8) ?? "Couldn't decode JSON" throw APIClientError(message: """ \(error) diff --git a/telegram/Sources/LandinhoBot/Common/URL+AsyncDataTask.swift b/telegram/Sources/LandinhoBot/Common/URL+AsyncDataTask.swift index a679807..d8c3898 100644 --- a/telegram/Sources/LandinhoBot/Common/URL+AsyncDataTask.swift +++ b/telegram/Sources/LandinhoBot/Common/URL+AsyncDataTask.swift @@ -11,7 +11,7 @@ import FoundationNetworking #endif extension URLSession { - func data(url: URL) async throws -> Data { + func data(from url: URL) async throws -> Data { try await withCheckedThrowingContinuation { continuation in let request = URLRequest(url: url) let task = dataTask(with: request) { data, _, error in