Added support for parameters handling in the MakeURLRequestUseCase use case.
This commit is contained in:
@@ -35,6 +35,12 @@ public struct MakeURLRequestUseCase {
|
||||
urlComponents.port = port
|
||||
}
|
||||
|
||||
if !endpoint.parameters.isEmpty {
|
||||
urlComponents.queryItems = endpoint.parameters
|
||||
.map(URLQueryItem.init)
|
||||
.sorted(by: { $0.name < $1.name })
|
||||
}
|
||||
|
||||
guard let url = urlComponents.url else {
|
||||
throw MakeURLRequestError.urlNotCreated
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user