adds a way for other project to call services on the api

sync3
Laurent 2 months ago
parent a972f48885
commit f738092e43
  1. 9
      LeStorage/Services.swift

@ -55,6 +55,15 @@ public class Services {
// MARK: - Base
/// Runs a request on the API and returns the appropriate response
/// - Parameters:
/// - path: the path of the service in the api, ie. "create-users/"
/// - method: the HTTP method to call
/// - requiresToken: whether the token must be included in the request
public func run<U: Decodable>(path: String, method: HTTPMethod, requiresToken: Bool) async throws -> U {
return try await self._runRequest(serviceCall: ServiceCall(path: path, method: method, requiresToken: requiresToken))
}
/// Runs a request using a configuration object
/// - Parameters:
/// - serviceConf: A instance of ServiceConf

Loading…
Cancel
Save