From 9364dc9e4faa2958cf1626c2f07f0f6fafccc4e2 Mon Sep 17 00:00:00 2001 From: Sacha DSO Date: Mon, 13 Nov 2023 15:16:43 -1000 Subject: [PATCH] Removes unnecessary Generic param on NetworkingRequest --- .../Calls/NetworkingClient+Requests.swift | 18 +++++++++--------- Sources/Networking/NetworkingRequest.swift | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Sources/Networking/Calls/NetworkingClient+Requests.swift b/Sources/Networking/Calls/NetworkingClient+Requests.swift index 078c01d..67b9efa 100644 --- a/Sources/Networking/Calls/NetworkingClient+Requests.swift +++ b/Sources/Networking/Calls/NetworkingClient+Requests.swift @@ -10,31 +10,31 @@ import Combine public extension NetworkingClient { - func getRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { + func getRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { request(.get, route, params: params) } - func postRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { + func postRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { request(.post, route, params: params) } - func putRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { + func putRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { request(.put, route, params: params) } - func patchRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { + func patchRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { request(.patch, route, params: params) } - func deleteRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { + func deleteRequest(_ route: String, params: Params = Params()) -> NetworkingRequest { request(.delete, route, params: params) } internal func request(_ httpMethod: HTTPMethod, _ route: String, params: Params = Params() - ) -> NetworkingRequest { - let req = NetworkingRequest() + ) -> NetworkingRequest { + let req = NetworkingRequest() req.httpMethod = httpMethod req.route = route req.params = params @@ -63,8 +63,8 @@ public extension NetworkingClient { _ route: String, params: Params = Params(), encodableBody: E? = nil - ) -> NetworkingRequest { - let req = NetworkingRequest() + ) -> NetworkingRequest { + let req = NetworkingRequest() req.httpMethod = httpMethod req.route = route req.params = Params() diff --git a/Sources/Networking/NetworkingRequest.swift b/Sources/Networking/NetworkingRequest.swift index a113c2d..8b5794d 100644 --- a/Sources/Networking/NetworkingRequest.swift +++ b/Sources/Networking/NetworkingRequest.swift @@ -10,14 +10,14 @@ import Combine public typealias NetworkRequestRetrier = (_ request: URLRequest, _ error: Error) -> AnyPublisher? -public class NetworkingRequest: NSObject, URLSessionTaskDelegate { +public class NetworkingRequest: NSObject, URLSessionTaskDelegate { var parameterEncoding = ParameterEncoding.urlEncoded var baseURL = "" var route = "" var httpMethod = HTTPMethod.get public var params = Params() - public var encodableBody: E? + public var encodableBody: Encodable? var headers = [String: String]() var multipartData: [MultipartData]? var logLevel: NetworkingLogLevel {