diff --git a/src/Api.elm b/src/Api.elm index 17c38cdb..2ab4f7ba 100644 --- a/src/Api.elm +++ b/src/Api.elm @@ -83,8 +83,15 @@ unwrapWithDefault default val = blockDecoder : Json.Decoder Block blockDecoder = - Json.map Block + Json.map2 Block (field "alerts" <| Json.list alertDecoder) + (field "routeOpts" routeOptsDecoder) + + +routeOptsDecoder : Json.Decoder RouteOpts +routeOptsDecoder = + Json.map RouteOpts + (field "receiver" Json.string) alertDecoder : Json.Decoder Alert diff --git a/src/Types.elm b/src/Types.elm index 50f77921..baca99d4 100644 --- a/src/Types.elm +++ b/src/Types.elm @@ -51,7 +51,13 @@ type alias Alert = type alias Block = - { alerts : List Alert } + { alerts : List Alert + , routeOpts : RouteOpts + } + + +type alias RouteOpts = + { receiver : String }