func deleteJobs(w rest.ResponseWriter, r *rest.Request) { s := r.PathParam("id") id, err := strconv.Atoi(s) if err != nil { return } RemoveJob(id) w.WriteHeader(http.StatusOK) }
func putJobs(w rest.ResponseWriter, r *rest.Request) { s := r.PathParam("id") id, err := strconv.Atoi(s) if err != nil { return } model := payload(w, r) if model == nil { return } UpdateJob(id, model.Name, model.Expression, model.Command) model.Id = id w.WriteJson(model) }