feat: add optional nulls=stripped parameter for mediatypes applicatio… (#2894)

This commit is contained in:
Taimoor Zaeem
2023-08-09 18:49:22 -05:00
committed by GitHub
parent d490bf09fd
commit fbf9bf21c2
13 changed files with 227 additions and 68 deletions
+1 -1
View File
@@ -206,7 +206,7 @@ writeQuery MutateReadPlan{mrReadPlan, mrMutatePlan, mrResAgg} apiReq@ApiRequest{
failNotSingular :: MediaType -> ResultSet -> DbHandler ()
failNotSingular _ RSPlan{} = pure ()
failNotSingular mediaType RSStandard{rsQueryTotal=queryTotal} =
when (mediaType == MTSingularJSON && queryTotal /= 1) $ do
when (elem mediaType [MTSingularJSON True,MTSingularJSON False] && queryTotal /= 1) $ do
lift SQL.condemn
throwError $ Error.singularityError queryTotal