Tolerate missing role in user creation

This commit is contained in:
calebmer
2015-10-07 20:01:46 -04:00
parent 2f551fea97
commit 8e107e5b24
6 changed files with 36 additions and 16 deletions
+1 -1
View File
@@ -141,7 +141,7 @@ app dbstructure conf reqBody dbrole req =
encode . object $ [("message", String "Failed to parse user.")]
Just u -> do
_ <- addUser (cs $ userId u)
(cs $ userPass u) (cs $ userRole u)
(cs $ userPass u) (cs <$> userRole u)
return $ responseLBS status201
[ jsonH
, (hLocation, "/postgrest/users?id=eq." <> cs (userId u))