feat: Begins migrating views from leaf to elementary

This commit is contained in:
2025-01-14 17:11:57 -05:00
parent 31c6b51371
commit 8842957cf3
23 changed files with 294 additions and 1136 deletions

View File

@@ -0,0 +1,23 @@
import DatabaseClientLive
import Dependencies
import Vapor
struct DependenciesMiddleware: AsyncMiddleware {
private let values: DependencyValues.Continuation
init() {
self.values = withEscapedDependencies { $0 }
}
func respond(to request: Request, chainingTo next: any AsyncResponder) async throws -> Response {
try await values.yield {
try await withDependencies {
$0.database = .live(database: request.db)
} operation: {
try await next.respond(to: request)
}
}
}
}