From 0ddf96c331397ee2b1b88781503fa188692dcfcc Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Wed, 22 Mar 2023 12:15:05 +0800 Subject: [PATCH] trying to appease codecov --- src/PostgREST/Plan.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/PostgREST/Plan.hs b/src/PostgREST/Plan.hs index 050bbb6b3b3..e88ef552c70 100644 --- a/src/PostgREST/Plan.hs +++ b/src/PostgREST/Plan.hs @@ -14,6 +14,7 @@ resource. {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE OverloadedRecordDot #-} module PostgREST.Plan ( wrappedReadPlan @@ -501,10 +502,10 @@ updateNode f (targetNodeName:remainingPath, a) (Right (Node rootNode forest)) = findNode = find (\(Node ReadPlan{relName, relAlias} _) -> relName == targetNodeName || relAlias == Just targetNodeName) forest mutatePlan :: Mutation -> QualifiedIdentifier -> ApiRequest -> SchemaCache -> ReadPlanTree -> Either Error MutatePlan -mutatePlan mutation qi ApiRequest{iPreferences=Preferences{..}, ..} sCache readReq = mapLeft ApiRequestError $ +mutatePlan mutation qi ApiRequest{iPreferences=preferences, ..} sCache readReq = mapLeft ApiRequestError $ case mutation of MutationCreate -> - mapRight (\typedColumns -> Insert qi typedColumns body ((,) <$> preferResolution <*> Just confCols) [] returnings pkCols applyDefaults) typedColumnsOrError + mapRight (\typedColumns -> Insert qi typedColumns body ((,) <$> preferences.preferResolution <*> Just confCols) [] returnings pkCols applyDefaults) typedColumnsOrError MutationUpdate -> mapRight (\typedColumns -> Update qi typedColumns body combinedLogic iTopLevelRange rootOrder returnings applyDefaults) typedColumnsOrError MutationSingleUpsert -> @@ -522,7 +523,7 @@ mutatePlan mutation qi ApiRequest{iPreferences=Preferences{..}, ..} sCache readR confCols = fromMaybe pkCols qsOnConflict QueryParams.QueryParams{..} = iQueryParams returnings = - if preferRepresentation == None + if preferences.preferRepresentation == None then [] else inferColsEmbedNeeds readReq pkCols pkCols = maybe mempty tablePKCols $ HM.lookup qi $ dbTables sCache @@ -532,7 +533,7 @@ mutatePlan mutation qi ApiRequest{iPreferences=Preferences{..}, ..} sCache readR body = payRaw <$> iPayload -- the body is assumed to be json at this stage(ApiRequest validates) tbl = HM.lookup qi $ dbTables sCache typedColumnsOrError = resolveOrError tbl `traverse` S.toList iColumns - applyDefaults = preferUndefinedKeys == Just ApplyDefaults + applyDefaults = preferences.preferUndefinedKeys == Just ApplyDefaults resolveOrError :: Maybe Table -> FieldName -> Either ApiRequestError TypedField resolveOrError Nothing _ = Left NotFound