Use rightToMaybe instead of case
This commit is contained in:
@@ -182,9 +182,7 @@ userApiRequest schema req reqBody
|
|||||||
other -> TargetUnknown other
|
other -> TargetUnknown other
|
||||||
shouldParsePayload = action `elem` [ActionCreate, ActionUpdate, ActionInvoke]
|
shouldParsePayload = action `elem` [ActionCreate, ActionUpdate, ActionInvoke]
|
||||||
relevantPayload = if shouldParsePayload
|
relevantPayload = if shouldParsePayload
|
||||||
then case payload of
|
then rightToMaybe payload
|
||||||
Right p -> Just p
|
|
||||||
Left _ -> Nothing
|
|
||||||
else Nothing
|
else Nothing
|
||||||
path = pathInfo req
|
path = pathInfo req
|
||||||
method = requestMethod req
|
method = requestMethod req
|
||||||
|
|||||||
Reference in New Issue
Block a user