Change nesting of if clause making code more symetrical
This commit is contained in:
@@ -162,15 +162,13 @@ userApiRequest schema req reqBody
|
|||||||
ct ->
|
ct ->
|
||||||
Left $ toS $ "Content-Type not acceptable: " <> toMime ct
|
Left $ toS $ "Content-Type not acceptable: " <> toMime ct
|
||||||
topLevelRange = fromMaybe allRange $ M.lookup "limit" ranges
|
topLevelRange = fromMaybe allRange $ M.lookup "limit" ranges
|
||||||
action =
|
action = case method of
|
||||||
if isTargetingProc
|
|
||||||
then ActionInvoke
|
|
||||||
else
|
|
||||||
case method of
|
|
||||||
"GET" -> if target == TargetRoot
|
"GET" -> if target == TargetRoot
|
||||||
then ActionInspect
|
then ActionInspect
|
||||||
else ActionRead
|
else ActionRead
|
||||||
"POST" -> ActionCreate
|
"POST" -> if isTargetingProc
|
||||||
|
then ActionInvoke
|
||||||
|
else ActionCreate
|
||||||
"PATCH" -> ActionUpdate
|
"PATCH" -> ActionUpdate
|
||||||
"DELETE" -> ActionDelete
|
"DELETE" -> ActionDelete
|
||||||
"OPTIONS" -> ActionInfo
|
"OPTIONS" -> ActionInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user