From 6ba4e967d5dfb5d3c7bb97a0f2662f3180595563 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Thu, 19 Mar 2026 15:17:38 -0500 Subject: feat: implement support for projects, lists, and pastes --- Hutch/Networking/SRHTService.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Hutch/Networking/SRHTService.swift') 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" -- cgit v1.2.3