More readable conditional
This commit is contained in:
+7
-6
@@ -133,12 +133,13 @@ app req =
|
|||||||
else do
|
else do
|
||||||
tableCols <- map (cs . colName) <$> columns qt
|
tableCols <- map (cs . colName) <$> columns qt
|
||||||
let cols = map cs $ keys obj
|
let cols = map cs $ keys obj
|
||||||
if S.fromList tableCols == S.fromList cols then do
|
if S.fromList tableCols == S.fromList cols
|
||||||
let vals = elems obj
|
then do
|
||||||
H.unit . coerce $ iffNotT
|
let vals = elems obj
|
||||||
(whereT qq $ update qt cols vals)
|
H.unit . coerce $ iffNotT
|
||||||
(insertSelect qt cols vals)
|
(whereT qq $ update qt cols vals)
|
||||||
return $ responseLBS status204 [ jsonH ] ""
|
(insertSelect qt cols vals)
|
||||||
|
return $ responseLBS status204 [ jsonH ] ""
|
||||||
|
|
||||||
else return $ if Prelude.null tableCols
|
else return $ if Prelude.null tableCols
|
||||||
then responseLBS status404 [] ""
|
then responseLBS status404 [] ""
|
||||||
|
|||||||
Reference in New Issue
Block a user