SPARK-1241: Username.ToLower

This commit is contained in:
Michael Harding committed 2018-06-12 17:33:20 -04:00
1 parent 508e2d4fcf
commit 8ab3182c21
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -36,14 +36,14 @@ let loginMsg user pass =
let update msg model =
match msg with
| Username u -> { model with user = u; error = "" }, Cmd.Empty
| Username u -> { model with user = u.ToLower(); error = "" }, Cmd.Empty
| Password p -> { model with password = p; error = "" }, Cmd.Empty
| Help ->
Global.alert Global.Info "Call support"
model, Cmd.Empty
| Submit ->
printfn "Login with %s %s" model.user model.password
model, loginMsg model.user model.password
model, loginMsg (model.user.ToLower()) model.password
| LoginFailure msg ->
{ model with error = msg }, Cmd.Empty
| LoginSuccess _ -> failwith "Handled externally. Should not get here."
+2 -2
View File
@@ -236,8 +236,8 @@ let update msg (model:Users.Types.Model) : Model * Cmd<Msg> =
| SaveUser ->
// match on id = 0 to see if it's a new user
match model.scratchUser.id with
| 0u -> { model with PreviousScratchUser = model.scratchUser}, Cmd.ofExistingPromise (createUser model.admin model.scratchUser) id (box>>ErrorOccured)
| _ -> model, Cmd.ofExistingPromise (saveUser model.admin model.scratchUser) id (box>>ErrorOccured)
| 0u -> { model with PreviousScratchUser = model.scratchUser}, Cmd.ofExistingPromise (createUser model.admin {model.scratchUser with name = model.scratchUser.name.ToLower() }) id (box>>ErrorOccured)
| _ -> model, Cmd.ofExistingPromise (saveUser model.admin {model.scratchUser with name = model.scratchUser.name.ToLower() }) id (box>>ErrorOccured)
| ErrorOccured msg ->
//Browser.console.log msg
Global.alert Global.Error (string msg)