aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/api/handler_wrapper.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-15 11:32:38 +0900
committernsfisis <nsfisis@gmail.com>2026-02-15 11:32:38 +0900
commit557b238e88189e1314c39af82d77c94ba9dbd19e (patch)
tree2014b2988fdc7ae90cce30159402ff3ac215725f /backend/api/handler_wrapper.go
parenta6b88139afc7c994ddb604757304d44214c00a90 (diff)
downloadphperkaigi-2026-albatross-557b238e88189e1314c39af82d77c94ba9dbd19e.tar.gz
phperkaigi-2026-albatross-557b238e88189e1314c39af82d77c94ba9dbd19e.tar.zst
phperkaigi-2026-albatross-557b238e88189e1314c39af82d77c94ba9dbd19e.zip
fix(backend): resolve TODO items for transactions, validation, and error handling
- Wrap multi-step DB operations in transactions (signup, submit, game edit, task result processing) - Add game running checks to PostGamePlayCode and PostGamePlaySubmit - Hide ranking code when game is not yet finished - Replace silenced errors in processTaskResults with slog.Error logging - Add pgxpool.Pool to Handler/Hub structs for transaction support Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'backend/api/handler_wrapper.go')
-rw-r--r--backend/api/handler_wrapper.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/backend/api/handler_wrapper.go b/backend/api/handler_wrapper.go
index 8e3e8cd..7448d13 100644
--- a/backend/api/handler_wrapper.go
+++ b/backend/api/handler_wrapper.go
@@ -5,6 +5,8 @@ package api
import (
"context"
+ "github.com/jackc/pgx/v5/pgxpool"
+
"albatross-2026-backend/config"
"albatross-2026-backend/db"
)
@@ -15,10 +17,11 @@ type HandlerWrapper struct {
impl Handler
}
-func NewHandler(queries *db.Queries, hub GameHubInterface, conf *config.Config) *HandlerWrapper {
+func NewHandler(queries *db.Queries, pool *pgxpool.Pool, hub GameHubInterface, conf *config.Config) *HandlerWrapper {
return &HandlerWrapper{
impl: Handler{
q: queries,
+ pool: pool,
hub: hub,
conf: conf,
},