Ignore the Range header when the method is different than GET
fix: bug when using Range header on PATCH/DELETE - Fix the "message": "syntax error at or near \"RETURNING\"" error - Fix doing a limited update/delete when an order query parameter was present breaking: The Range header is now only considered on GET requests and is ignored for any other method - Other methods should use the `limit/offset` query parameters for sub-ranges - PUT requests no longer return an error when this header is present
This commit is contained in:
@@ -38,7 +38,7 @@ spec =
|
||||
it "allows full table update if a filter is present" $
|
||||
baseTable "safe_update_items" "id" tblDataBefore
|
||||
`mutatesWith`
|
||||
requestMutation methodPatch "/safe_update_items?id=gt.0" [json| {"name": "updated-item"} |]
|
||||
requestMutation methodPatch "/safe_update_items?id=gt.0" mempty [json| {"name": "updated-item"} |]
|
||||
`shouldMutateInto`
|
||||
[json|[
|
||||
{ "id": 1, "name": "updated-item", "observation": null }
|
||||
@@ -61,7 +61,7 @@ spec =
|
||||
it "allows full table delete if a filter is present" $
|
||||
baseTable "safe_delete_items" "id" tblDataBefore
|
||||
`mutatesWith`
|
||||
requestMutation methodDelete "/safe_delete_items?id=gt.0" mempty
|
||||
requestMutation methodDelete "/safe_delete_items?id=gt.0" mempty mempty
|
||||
`shouldMutateInto`
|
||||
[json|[]|]
|
||||
|
||||
@@ -72,7 +72,7 @@ disabledSpec =
|
||||
it "works if no condition is present" $
|
||||
baseTable "unsafe_update_items" "id" tblDataBefore
|
||||
`mutatesWith`
|
||||
requestMutation methodPatch "/unsafe_update_items" [json| {"name": "updated-item"} |]
|
||||
requestMutation methodPatch "/unsafe_update_items" mempty [json| {"name": "updated-item"} |]
|
||||
`shouldMutateInto`
|
||||
[json|[
|
||||
{ "id": 1, "name": "updated-item", "observation": null }
|
||||
@@ -84,6 +84,6 @@ disabledSpec =
|
||||
it "works if no condition is present" $
|
||||
baseTable "unsafe_delete_items" "id" tblDataBefore
|
||||
`mutatesWith`
|
||||
requestMutation methodDelete "/unsafe_delete_items" mempty
|
||||
requestMutation methodDelete "/unsafe_delete_items" mempty mempty
|
||||
`shouldMutateInto`
|
||||
[json|[]|]
|
||||
|
||||
Reference in New Issue
Block a user