Skip to content

Commit

Permalink
backend/feat/#354/adding-orderBy-in-findAllWithKVAndConditionalDBInte…
Browse files Browse the repository at this point in the history
…rnal
  • Loading branch information
JanhaviSoni committed Dec 22, 2023
1 parent c2c9c8d commit 2673278
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions lib/mobility-core/src/Kernel/Beam/Functions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,13 @@ findAllWithKVAndConditionalDB ::
FromTType' (table Identity) a
) =>
Where Postgres table ->
Maybe (OrderBy table) ->
m [a]
findAllWithKVAndConditionalDB where' = do
findAllWithKVAndConditionalDB where' orderBy = do
updatedMeshConfig <- setMeshConfig (modelTableName @table) (modelSchemaName @table) meshConfig
inReplica <- L.getOptionLocal ReplicaEnabled
dbConf' <- maybe getMasterDBConfig (\inReplica' -> if inReplica' then getReplicaDbConfig else getMasterDBConfig) inReplica
result <- KV.findAllWithKVAndConditionalDBInternal dbConf' updatedMeshConfig where'
result <- KV.findAllWithKVAndConditionalDBInternal dbConf' updatedMeshConfig where' orderBy
case result of
Right res -> do
res' <- mapM fromTType' res
Expand Down

0 comments on commit 2673278

Please sign in to comment.