feat: Refactoring route declarations.

This commit is contained in:
2025-01-26 01:16:59 -05:00
parent 0fad024350
commit 4dc928e1f4
34 changed files with 592 additions and 606 deletions

View File

@@ -14,15 +14,15 @@ public extension DependencyValues {
public struct ApiController: Sendable {
public var json: @Sendable (Request) async throws -> (any Encodable)?
public func json(_ route: ApiRoute, logger: Logger) async throws -> (any Encodable)? {
public func json(_ route: SiteRoute.Api, logger: Logger) async throws -> (any Encodable)? {
try await json(.init(route, logger: logger))
}
public struct Request: Sendable {
public let route: ApiRoute
public let route: SiteRoute.Api
public let logger: Logger
public init(_ route: ApiRoute, logger: Logger) {
public init(_ route: SiteRoute.Api, logger: Logger) {
self.route = route
self.logger = logger
}