disallow limit/offset on views

This commit is contained in:
steve-chavez
2022-03-26 15:29:13 +01:00
committed by Steve Chavez
parent 73dc2692b1
commit f3f9030c48
8 changed files with 52 additions and 7 deletions
+10 -1
View File
@@ -3,7 +3,7 @@ module Feature.Query.DeleteSpec where
import Network.Wai (Application)
import Network.HTTP.Types
import Test.Hspec
import Test.Hspec hiding (pendingWith)
import Test.Hspec.Wai
import Test.Hspec.Wai.JSON
@@ -213,7 +213,16 @@ spec =
`shouldRespondWith` ""
{ matchStatus = 204 }
it "doesn't work with views" $
request methodDelete "/limited_delete_items_view?limit=1&offset=1"
[("Prefer", "tx=commit")]
mempty
`shouldRespondWith`
[json| {"hint":null,"details":null,"code":"PGRST507","message":"limit/offset is not implemented for views"} |]
{ matchStatus = 501 }
it "works with views with an inferred pk" $ do
pendingWith "not implemented yet"
get "/limited_delete_items_view"
`shouldRespondWith`
[json|[