diff options
| author | Joris | 2017-03-24 09:21:06 +0000 | 
|---|---|---|
| committer | Joris | 2017-03-24 09:21:06 +0000 | 
| commit | c0ac16a713c4e53cf6af8e72a6d5f6b8ac5d6456 (patch) | |
| tree | 8a438430cee7411259fc395d8f3898488e85d750 /src/client/elm/Model/Init.elm | |
| parent | 293eb8295162bf0a038f488237db9c9d1316c04d (diff) | |
| parent | cfca18262c1ff48dcb683ddab7d03cf8e55573ff (diff) | |
Merge branch 'features/categories' into 'master'
Features/categories
See merge request !1
Diffstat (limited to 'src/client/elm/Model/Init.elm')
| -rw-r--r-- | src/client/elm/Model/Init.elm | 22 | 
1 files changed, 14 insertions, 8 deletions
| diff --git a/src/client/elm/Model/Init.elm b/src/client/elm/Model/Init.elm index 3a86dba..db7069f 100644 --- a/src/client/elm/Model/Init.elm +++ b/src/client/elm/Model/Init.elm @@ -3,23 +3,29 @@ module Model.Init exposing    , initDecoder    ) -import Json.Decode as Json exposing ((:=)) +import Json.Decode as Decode exposing (Decoder)  import Model.Payment exposing (Payments, paymentsDecoder) -import Model.Income exposing (Incomes, incomesDecoder)  import Model.User exposing (Users, UserId, usersDecoder, userIdDecoder) +import Model.Income exposing (Incomes, incomesDecoder) +import Model.Category exposing (Categories, categoriesDecoder) +import Model.PaymentCategory exposing (PaymentCategories, paymentCategoriesDecoder)  type alias Init =    { users : Users    , me : UserId    , payments : Payments    , incomes : Incomes +  , categories : Categories +  , paymentCategories : PaymentCategories    } -initDecoder : Json.Decoder Init +initDecoder : Decoder Init  initDecoder = -  Json.object4 Init -    ("users" := usersDecoder) -    ("me" := userIdDecoder) -    ("payments" := paymentsDecoder) -    ("incomes" := incomesDecoder) +  Decode.map6 Init +    (Decode.field "users" usersDecoder) +    (Decode.field "me" userIdDecoder) +    (Decode.field "payments" paymentsDecoder) +    (Decode.field "incomes" incomesDecoder) +    (Decode.field "categories" categoriesDecoder) +    (Decode.field "paymentCategories" paymentCategoriesDecoder) | 
