Skip to content

Commit

Permalink
fix path
Browse files Browse the repository at this point in the history
  • Loading branch information
joselinoneto committed Jun 2, 2021
1 parent 278637e commit 4007932
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Sources/ToolboxAPIClient/BaseNetworkWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ public class BaseNetworkWorker<T> where T: Codable {
private var finalUrl: URL {
get {
var components = URLComponents(url: targetType.baseURL, resolvingAgainstBaseURL: true)
print(targetType)
if targetType.queryString.count > 0 {
components?.queryItems = targetType.queryString
}
guard let url = components?.url else {
preconditionFailure("Invalid URL components")
}
return url
let finalUrl: URL = url.appendingPathComponent(targetType.path)
return finalUrl
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extension StoryTarget: TargetType {
}

public var baseURL: URL {
URL(string: "https://astronomia-api.herokuapp.com/")!
URL(string: "https://astronomia-staging.herokuapp.com/")!
}

public var path: String {
Expand All @@ -59,6 +59,6 @@ extension StoryTarget: TargetType {
}

public var headers: [String : String]? {
["Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiIxMTY3MDNFOS1CRjdFLTQyMEEtQjhFRi1BMjY1MTI5NzlEMjEiLCJzdWIiOiJhc3Ryb25vbWlhX2FwaSIsImV4cCI6NjQwOTIyMTEyMDAsImFkbWluIjp0cnVlfQ.D-ZoYLLVfdGaXrIfVl5BlKslN2oFezBpa0PguKCXmhs"]
["Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyaWQiOiI4NUNFMjJCMi0xMzExLTRCRjgtOUIwMy1GQTFCREYzQkUyOTIiLCJzdWIiOiJhc3Ryb25vbWlhX2FwaSIsImV4cCI6NjQwOTIyMTEyMDAsImFkbWluIjp0cnVlfQ.0AR701FCTjs9A90Nev5GGgVujnXwV4wgSkCrqjVkhYg"]
}
}

0 comments on commit 4007932

Please sign in to comment.