refactor: pass AuthResult to txVarQuery

Saves one parameter to the function.
This commit is contained in:
steve-chavez
2025-09-10 09:04:12 -05:00
committed by Steve Chavez
parent 966a611d7f
commit 1d2a3e8501
2 changed files with 8 additions and 9 deletions
+2 -2
View File
@@ -106,7 +106,7 @@ data ResultSet
query :: AppConfig -> AuthResult -> ApiRequest -> ActionPlan -> SchemaCache -> Query
query _ _ _ (NoDb x) _ = NoDbQuery $ NoDbResult x
query conf@AppConfig{..} AuthResult{..} apiReq (Db plan) sCache =
query conf@AppConfig{..} auth@AuthResult{..} apiReq (Db plan) sCache =
DbQuery isoLvl txMode dbHandler transaction mainSQLQuery
where
transaction = if configDbPreparedStatements then SQL.transaction else SQL.unpreparedTransaction
@@ -115,7 +115,7 @@ query conf@AppConfig{..} AuthResult{..} apiReq (Db plan) sCache =
(mainActionQuery, mainSQLQuery) = actionQuery plan conf apiReq sCache
dbHandler = do
lift $ SQL.statement mempty $ SQL.dynamicallyParameterized
(PreQuery.txVarQuery plan conf authClaims authRole apiReq)
(PreQuery.txVarQuery plan conf auth apiReq)
HD.noResult configDbPreparedStatements
lift $ whenJust configDbPreRequest $ \prereq -> do
SQL.statement mempty $ SQL.dynamicallyParameterized (PreQuery.preReqQuery prereq) HD.noResult configDbPreparedStatements