mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 10:58:26 +00:00
Using elm-format for all files
This commit is contained in:
@ -1,28 +1,39 @@
|
||||
module Data.Flags exposing (..)
|
||||
module Data.Flags exposing
|
||||
( Config
|
||||
, Flags
|
||||
, getToken
|
||||
, withAccount
|
||||
, withoutAccount
|
||||
)
|
||||
|
||||
import Api.Model.AuthResult exposing (AuthResult)
|
||||
|
||||
|
||||
type alias Config =
|
||||
{ appName: String
|
||||
, baseUrl: String
|
||||
, signupMode: String
|
||||
, docspellAssetPath: String
|
||||
{ appName : String
|
||||
, baseUrl : String
|
||||
, signupMode : String
|
||||
, docspellAssetPath : String
|
||||
}
|
||||
|
||||
|
||||
type alias Flags =
|
||||
{ account: Maybe AuthResult
|
||||
, config: Config
|
||||
{ account : Maybe AuthResult
|
||||
, config : Config
|
||||
}
|
||||
|
||||
getToken: Flags -> Maybe String
|
||||
|
||||
getToken : Flags -> Maybe String
|
||||
getToken flags =
|
||||
flags.account
|
||||
|> Maybe.andThen (\a -> a.token)
|
||||
|
||||
withAccount: Flags -> AuthResult -> Flags
|
||||
|
||||
withAccount : Flags -> AuthResult -> Flags
|
||||
withAccount flags acc =
|
||||
{ flags | account = Just acc }
|
||||
|
||||
withoutAccount: Flags -> Flags
|
||||
|
||||
withoutAccount : Flags -> Flags
|
||||
withoutAccount flags =
|
||||
{ flags | account = Nothing }
|
||||
|
Reference in New Issue
Block a user