refactor: dry RPC param parsing

This commit is contained in:
steve-chavez
2023-01-18 12:26:13 -05:00
committed by Steve Chavez
parent 8f80cd1469
commit be6c30a0fb
7 changed files with 66 additions and 81 deletions
+2 -1
View File
@@ -1002,7 +1002,8 @@ spec actualPgVersion = do
{ matchHeaders = [matchContentTypeJson] }
it "fails if an operator is not given" $
get "/ghostBusters?id=0" `shouldRespondWith` [json| {"details":"Failed to parse [(\"id\",\"0\")]","message":"Unexpected param or filter missing operator","code":"PGRST104","hint":null} |]
get "/ghostBusters?id=0" `shouldRespondWith`
[json| {"code":"PGRST100","details":"unexpected end of input expecting operator (eq, gt, ...)","hint":null,"message":"\"failed to parse filter (0)\" (line 1, column 2)"} |]
{ matchStatus = 400
, matchHeaders = [matchContentTypeJson]
}