Add lamassu-admin-elm to this repo (#185)
This commit is contained in:
parent
5ee7e40872
commit
f4fc9d6328
134 changed files with 28171 additions and 83 deletions
22
lamassu-admin-elm/src/AccountDecoder.elm
Normal file
22
lamassu-admin-elm/src/AccountDecoder.elm
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
module AccountDecoder exposing (..)
|
||||
|
||||
import Json.Decode exposing (..)
|
||||
import FieldSet.Rest exposing (..)
|
||||
import AccountTypes exposing (..)
|
||||
|
||||
|
||||
accountDecoder : Decoder Account
|
||||
accountDecoder =
|
||||
map3 Account
|
||||
(field "code" string)
|
||||
(field "display" string)
|
||||
(field "fields" (list fieldDecoder))
|
||||
|
||||
|
||||
type alias AccountResult =
|
||||
Result String Account
|
||||
|
||||
|
||||
decodeAccount : String -> AccountResult
|
||||
decodeAccount string =
|
||||
decodeString accountDecoder string
|
||||
Loading…
Add table
Add a link
Reference in a new issue