mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-03-28 09:45:07 +00:00
23 lines
444 B
Elm
23 lines
444 B
Elm
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 }
|