mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Initial application stub
This commit is contained in:
22
modules/webapp/src/main/elm/Data/Flags.elm
Normal file
22
modules/webapp/src/main/elm/Data/Flags.elm
Normal file
@ -0,0 +1,22 @@
|
||||
module Data.Flags exposing (..)
|
||||
|
||||
import Api.Model.AuthResult exposing (AuthResult)
|
||||
|
||||
type alias Config =
|
||||
{ appName: String
|
||||
, baseUrl: String
|
||||
}
|
||||
|
||||
type alias Flags =
|
||||
{ account: Maybe AuthResult
|
||||
, config: Config
|
||||
}
|
||||
|
||||
getToken: Flags -> Maybe String
|
||||
getToken flags =
|
||||
flags.account
|
||||
|> Maybe.andThen (\a -> a.token)
|
||||
|
||||
withAccount: Flags -> AuthResult -> Flags
|
||||
withAccount flags acc =
|
||||
{ flags | account = Just acc }
|
Reference in New Issue
Block a user