mirror of
https://github.com/prometheus/alertmanager
synced 2025-02-20 12:46:59 +00:00
Fix silence destroy return expectation
Also remove unused "error" string
This commit is contained in:
parent
eab27236be
commit
7be6c13297
@ -37,7 +37,7 @@ init location =
|
||||
route =
|
||||
Parsing.urlParser location
|
||||
in
|
||||
update (urlUpdate location) (Model Loading Loading Loading route "")
|
||||
update (urlUpdate location) (Model Loading Loading Loading route)
|
||||
|
||||
|
||||
nullSilence : Silence
|
||||
|
@ -66,7 +66,7 @@ destroy silence =
|
||||
Http.emptyBody
|
||||
-- Body being sent
|
||||
, expect =
|
||||
(Http.expectJson Silences.Decoders.create)
|
||||
(Http.expectJson Silences.Decoders.destroy)
|
||||
-- Response expected
|
||||
, timeout =
|
||||
Nothing
|
||||
|
@ -26,6 +26,15 @@ create =
|
||||
(Json.at [ "data", "silenceId" ] Json.int)
|
||||
|
||||
|
||||
|
||||
-- This should just be the ID
|
||||
|
||||
|
||||
destroy : Json.Decoder String
|
||||
destroy =
|
||||
(Json.at [ "status" ] Json.string)
|
||||
|
||||
|
||||
silence : Json.Decoder Silence
|
||||
silence =
|
||||
Json.map7 Silence
|
||||
|
@ -18,7 +18,6 @@ type alias Model =
|
||||
, silence : ApiData Silence
|
||||
, alertGroups : ApiData (List AlertGroup)
|
||||
, route : Route
|
||||
, error : String
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +50,7 @@ type Msg
|
||||
= SilenceFetch (ApiData Silence)
|
||||
| SilencesFetch (ApiData (List Silence))
|
||||
| SilenceCreate (Result Http.Error Int)
|
||||
| SilenceDestroy (Result Http.Error Int)
|
||||
| SilenceDestroy (Result Http.Error String)
|
||||
| FetchSilences
|
||||
| FetchSilence Int
|
||||
| NewSilence
|
||||
|
Loading…
Reference in New Issue
Block a user