Change nesting of if clause making code more symetrical

This commit is contained in:
Diogo Biazus
2016-11-27 23:55:07 -05:00
parent 090a62a2c8
commit 98ada3f9ee
+4 -6
View File
@@ -162,15 +162,13 @@ userApiRequest schema req reqBody
ct ->
Left $ toS $ "Content-Type not acceptable: " <> toMime ct
topLevelRange = fromMaybe allRange $ M.lookup "limit" ranges
action =
if isTargetingProc
then ActionInvoke
else
case method of
action = case method of
"GET" -> if target == TargetRoot
then ActionInspect
else ActionRead
"POST" -> ActionCreate
"POST" -> if isTargetingProc
then ActionInvoke
else ActionCreate
"PATCH" -> ActionUpdate
"DELETE" -> ActionDelete
"OPTIONS" -> ActionInfo