Skip to content

Commit

Permalink
api: implement delete notification
Browse files Browse the repository at this point in the history
  • Loading branch information
jzelinskie committed Feb 24, 2016
1 parent 96e96d9 commit b9a6da4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api/v1/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,16 @@ func getNotification(w http.ResponseWriter, r *http.Request, p httprouter.Params
}

func deleteNotification(w http.ResponseWriter, r *http.Request, p httprouter.Params, ctx *context.RouteContext) int {
// ez
return 0
err := ctx.Store.DeleteNotification(p.ByName("notificationName"))
if err == cerrors.ErrNotFound {
writeResponse(w, NotificationEnvelope{Error: &Error{err.Error()}})
return writeHeader(w, http.StatusNotFound)
} else if err != nil {
writeResponse(w, NotificationEnvelope{Error: &Error{err.Error()}})
return writeHeader(w, http.StatusInternalServerError)
}

return writeHeader(w, http.StatusOK)
}

func getMetrics(w http.ResponseWriter, r *http.Request, p httprouter.Params, ctx *context.RouteContext) int {
Expand Down

0 comments on commit b9a6da4

Please sign in to comment.