Skip to content

Commit

Permalink
Clean comments
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenceisla committed Jul 20, 2022
1 parent 13297a0 commit 0b2d13d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/PostgREST/Query/QueryBuilder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ mutateRequestToQuery (Delete mainQi body logicForest pkFlts range ordts returnin
else "WITH " <> normalizedBody body <> " ") <>
"DELETE FROM " <> SQL.sql (fromQi mainQi) <> " " <>
(if not (null logicForest) || hasEmptyBody
then mempty else
"USING (SELECT * FROM json_populate_recordset (null::" <> SQL.sql (fromQi mainQi) <> " , " <> SQL.sql selectBody <> " )) pgrst_delete_body ") <>
then mempty
else "USING (SELECT * FROM json_populate_recordset (null::" <> SQL.sql (fromQi mainQi) <> " , " <> SQL.sql selectBody <> " )) pgrst_delete_body ") <>
"WHERE " <> whereLogic <> " " <>
SQL.sql (returningF mainQi returnings)

Expand Down
4 changes: 2 additions & 2 deletions src/PostgREST/Request/ApiRequest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import qualified PostgREST.Request.Preferences as Preferences
import qualified PostgREST.Request.QueryParams as QueryParams

import Protolude
--import Debug.Trace as BUG


type RequestBody = LBS.ByteString

Expand Down Expand Up @@ -269,7 +269,7 @@ apiRequest conf@AppConfig{..} dbStructure req reqBody queryparams@QueryParams{..
payload :: Either ByteString Payload
payload = case (contentMediaType, pathIsProc) of
(MTApplicationJSON, _) ->
if isJust columns -- || method == "DELETE" -- For DELETES, always searches for primary keys only
if isJust columns
then Right $ RawJSON reqBody
else note "All object keys must match" . payloadAttributes reqBody
=<< if LBS.null reqBody && pathIsProc
Expand Down
2 changes: 1 addition & 1 deletion src/PostgREST/Request/DbRequestBuilder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import PostgREST.Request.Types
import qualified PostgREST.Request.QueryParams as QueryParams

import Protolude hiding (from)
--import Debug.Trace as BUG

-- | Builds the ReadRequest tree on a number of stages.
-- | Adds filters, order, limits on its respective nodes.
-- | Adds joins conditions obtained from resource embedding.
Expand Down

0 comments on commit 0b2d13d

Please sign in to comment.