diff --git a/Sources/NetworkApi/Interfaces/BaseNetworkService.swift b/Sources/NetworkApi/Interfaces/BaseNetworkService.swift index 2bb231b..0302317 100644 --- a/Sources/NetworkApi/Interfaces/BaseNetworkService.swift +++ b/Sources/NetworkApi/Interfaces/BaseNetworkService.swift @@ -10,7 +10,7 @@ public final class BaseNetworkService: BaseNetworkServiceProtocol { public init() {} - public func execute(path: String, method: HTTPMethod, headers: HTTPHeaders, parameters: Parameters) async throws -> Data { + public func execute(path: String, method: HTTPMethod, headers: HTTPHeaders, parameters: Parameters? = nil) async throws -> Data { guard let baseURL = baseURL else { fatalError("Error baseURL") } diff --git a/Sources/NetworkApi/Interfaces/BaseNetworkServiceProtocol.swift b/Sources/NetworkApi/Interfaces/BaseNetworkServiceProtocol.swift index 8db4ff0..1cce6fb 100644 --- a/Sources/NetworkApi/Interfaces/BaseNetworkServiceProtocol.swift +++ b/Sources/NetworkApi/Interfaces/BaseNetworkServiceProtocol.swift @@ -5,6 +5,6 @@ import Alamofire import Foundation public protocol BaseNetworkServiceProtocol { - func execute(path: String, method: HTTPMethod, headers: HTTPHeaders, parameters: Parameters) async throws -> Data + func execute(path: String, method: HTTPMethod, headers: HTTPHeaders, parameters: Parameters?) async throws -> Data func configure(baseURL: String) } diff --git a/Sources/NetworkApi/NetworkLayer/Auth/NetworkUser.swift b/Sources/NetworkApi/NetworkLayer/Auth/NetworkUser.swift index a9d6b73..3607a26 100644 --- a/Sources/NetworkApi/NetworkLayer/Auth/NetworkUser.swift +++ b/Sources/NetworkApi/NetworkLayer/Auth/NetworkUser.swift @@ -53,7 +53,7 @@ public final class NetworkUser: NetworkUserProtocol { } public func getIdToken(token: String) async throws -> String { - let data = try await baseUrl.execute(path: URLS.getIdToken, method: .get, headers: Headers.headerWithToken(token: token), parameters: [:]) + let data = try await baseUrl.execute(path: URLS.getIdToken, method: .get, headers: Headers.headerWithToken(token: token), parameters: nil) let tokenID = try JSONDecoder().decode(ServerResponseIdToken.self, from: data) return tokenID.items.id }