Rework db package to make it testable

This commit is contained in:
2024-11-21 22:36:12 +01:00
parent 2faefb6db5
commit 807e96a76c
16 changed files with 274 additions and 161 deletions

View File

@@ -29,7 +29,7 @@ func WithUserContext(next http.Handler) http.Handler {
}
// Workspace context
func WithWorkspaceContext(db *db.DB) func(http.Handler) http.Handler {
func WithWorkspaceContext(db db.Database) func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx, ok := httpcontext.GetRequestContext(w, r)