From b158b4924eeaff328e3eb89a31247f7d230bc921 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Sun, 27 Nov 2016 23:55:14 -0500 Subject: [PATCH] Use rightToMaybe instead of case --- src/PostgREST/ApiRequest.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/PostgREST/ApiRequest.hs b/src/PostgREST/ApiRequest.hs index 877774bf6..1159c0013 100644 --- a/src/PostgREST/ApiRequest.hs +++ b/src/PostgREST/ApiRequest.hs @@ -182,9 +182,7 @@ userApiRequest schema req reqBody other -> TargetUnknown other shouldParsePayload = action `elem` [ActionCreate, ActionUpdate, ActionInvoke] relevantPayload = if shouldParsePayload - then case payload of - Right p -> Just p - Left _ -> Nothing + then rightToMaybe payload else Nothing path = pathInfo req method = requestMethod req