Skip to content

Commit

Permalink
Merge pull request #24 from ski-u/run-swift-format
Browse files Browse the repository at this point in the history
Run swift-format
  • Loading branch information
ski-u authored Dec 21, 2024
2 parents 9a1822e + 6dedc26 commit 96279f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Features/Sources/APIClientLive/LiveKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Models

extension APIClient: DependencyKey {
private static let apiKeyClient = APIKeyClient.liveValue

public static var liveValue: Self {
.init(
apod: {
Expand All @@ -19,16 +19,16 @@ extension APIClient: DependencyKey {
}
)
}

private static func request(to path: String) async throws -> (Data, URLResponse) {
let baseURL = URL(string: "https://api.nasa.gov")!

var urlComponents = URLComponents(url: baseURL, resolvingAgainstBaseURL: false)!
urlComponents.path = "/planetary/\(path)"
urlComponents.queryItems = [
URLQueryItem(name: "api_key", value: apiKeyClient.getKey()?.rawValue)
]

return try await URLSession.shared.data(from: urlComponents.url!)
}
}
4 changes: 2 additions & 2 deletions Features/Sources/Settings/APIKey/APIKeySetting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct APIKeySetting {
case onAppear
case setAPIKeyInput(String)
case updateButtonTapped

@CasePathable
public enum Delegate {
case updated
Expand All @@ -41,7 +41,7 @@ public struct APIKeySetting {
switch action {
case .delegate:
return .none

case .onAppear:
state.apiKeyInput = apiKeyClient.getKey() ?? .init(rawValue: "")
return .none
Expand Down

0 comments on commit 96279f6

Please sign in to comment.