diff options
Diffstat (limited to 'Hutch/Networking/SRHTService.swift')
| -rw-r--r-- | Hutch/Networking/SRHTService.swift | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Hutch/Networking/SRHTService.swift b/Hutch/Networking/SRHTService.swift index 5db06dd..416b733 100644 --- a/Hutch/Networking/SRHTService.swift +++ b/Hutch/Networking/SRHTService.swift @@ -3,6 +3,7 @@ import Foundation /// Each Sourcehut service exposes its own GraphQL endpoint. enum SRHTService: String, Codable, Sendable, CaseIterable { case meta + case hub case git case hg case builds @@ -14,13 +15,19 @@ enum SRHTService: String, Codable, Sendable, CaseIterable { /// The GraphQL endpoint URL for this service. var url: URL { - // Force-unwrap is safe here — these are compile-time constant strings. - URL(string: "https://\(rawValue).sr.ht/query")! + switch self { + case .hub: + URL(string: "https://sr.ht/query")! + default: + // Force-unwrap is safe here — these are compile-time constant strings. + URL(string: "https://\(rawValue).sr.ht/query")! + } } var displayName: String { switch self { case .meta: "Meta" + case .hub: "Hub" case .git: "Git" case .hg: "Mercurial" case .builds: "Builds" |
