Added support for parameters handling in the MakeURLRequestUseCase use case.

This commit is contained in:
2023-04-19 00:51:06 +02:00
parent e5b511d226
commit 470478c3d5
2 changed files with 33 additions and 6 deletions
@@ -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
}