18 lines
316 B
Elm
18 lines
316 B
Elm
|
module Deck exposing (..)
|
||
|
|
||
|
import Json.Decode
|
||
|
import Json.Decode.Pipeline as JDP
|
||
|
|
||
|
|
||
|
type alias Deck =
|
||
|
{ id : Int
|
||
|
, name : String
|
||
|
}
|
||
|
|
||
|
|
||
|
decode : Json.Decode.Decoder Deck
|
||
|
decode =
|
||
|
Json.Decode.succeed Deck
|
||
|
|> JDP.required "deck_id" Json.Decode.int
|
||
|
|> JDP.required "name" Json.Decode.string
|