From 57dc6e396f0b96911f74765228bdf38ab91a1e71 Mon Sep 17 00:00:00 2001 From: Blacky <106263486+Black-Fox-2022@users.noreply.github.com> Date: Tue, 21 May 2024 12:06:52 +0200 Subject: [PATCH] Update API Version fix #169 --- APIClient/APIClient.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/APIClient/APIClient.swift b/APIClient/APIClient.swift index 7c0da38..7c48de1 100644 --- a/APIClient/APIClient.swift +++ b/APIClient/APIClient.swift @@ -93,8 +93,9 @@ final class APIClient: ObservableObject { } extension APIClient { + func login(loginRequestBody: LoginRequestBody, callback: @escaping (Bool) -> Void) { - let url = urlForPath("users", "login") + let url = urlForPath(apiVersion: .v3,"users", "login") var request = URLRequest(url: url) request.httpMethod = "POST" @@ -103,7 +104,6 @@ extension APIClient { URLSession.shared.dataTask(with: request) { data, _, _ in if let data = data { print(String(decoding: data, as: UTF8.self)) - if let decodedResponse = try? JSONDecoder.telemetryDecoder.decode(UserTokenDTO.self, from: data) { DispatchQueue.main.async { self.userToken = decodedResponse