blob: 0e118dc538d52ab0331f6f7a52110a1d819d009d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
module Update.SignIn
( SignInAction(..)
, updateSignIn
) where
import Model.View.SignIn exposing (..)
type SignInAction =
UpdateLogin String
| ValidLogin String
| ErrorLogin String
updateSignIn : SignInAction -> SignIn -> SignIn
updateSignIn action signIn =
case action of
UpdateLogin login ->
{ signIn | login <- login }
ValidLogin message ->
{ signIn
| login <- ""
, result <- Just (Ok message)
}
ErrorLogin message ->
{ signIn | result <- Just (Err message) }
|