This commit is contained in:
Aakiyaru 2025-05-27 15:15:43 +07:00
parent 9e25357a56
commit fe8f570fd0
3 changed files with 3 additions and 3 deletions

View File

@ -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")
}

View File

@ -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)
}

View File

@ -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
}