Forgot to implement the initialiser and make the "callAsFunction(endpoint: )" function public in the MakeURLrequestUseCase use case.

This commit is contained in:
Javier Cicchelli 2023-04-10 15:23:20 +02:00
parent 324a82a8e7
commit 35c2340a9b

View File

@ -11,12 +11,16 @@ import Foundation
/// This use case generate a url request out of a given endpoint.
public struct MakeURLRequestUseCase {
// MARK: Initialisers
public init() {}
// MARK: Functions
/// Generate a `URLRequest` instance out of a given endpoint that conforms to the `Endpoint` protocol.
/// - Parameter endpoint: An endpoint which is used to generate a `URLRequest` instance from.
/// - Returns: A `URLRequest` instance filled with data provided by the given endpoint.
func callAsFunction(endpoint: some Endpoint) throws -> URLRequest {
public func callAsFunction(endpoint: some Endpoint) throws -> URLRequest {
var urlComponents = URLComponents()
urlComponents.scheme = endpoint.scheme