Use rightToMaybe instead of case

This commit is contained in:
Diogo Biazus
2016-11-27 23:55:14 -05:00
parent 98ada3f9ee
commit b158b4924e
+1 -3
View File
@@ -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