Revert "refactor: plan media type"

This reverts commit 3cd3a3f8c6.
This commit is contained in:
steve-chavez
2023-06-18 15:27:25 -05:00
committed by Steve Chavez
parent 3cd3a3f8c6
commit 77cd9387d4
11 changed files with 100 additions and 157 deletions
+2 -3
View File
@@ -46,8 +46,7 @@ import PostgREST.Config (AppConfig (..),
import PostgREST.Config.PgVersion (PgVersion (..),
pgVersion140)
import PostgREST.Error (Error)
import PostgREST.MediaType (MediaType (..),
NormalMedia (..))
import PostgREST.MediaType (MediaType (..))
import PostgREST.Plan (CallReadPlan (..),
MutateReadPlan (..),
WrappedReadPlan (..))
@@ -208,7 +207,7 @@ writeQuery MutateReadPlan{mrReadPlan, mrMutatePlan} apiReq@ApiRequest{iPreferenc
failNotSingular :: MediaType -> ResultSet -> DbHandler ()
failNotSingular _ RSPlan{} = pure ()
failNotSingular mediaType RSStandard{rsQueryTotal=queryTotal} =
when (mediaType == MTNormal MTSingularJSON && queryTotal /= 1) $ do
when (mediaType == MTSingularJSON && queryTotal /= 1) $ do
lift SQL.condemn
throwError $ Error.singularityError queryTotal