Server qr fixes.
This commit is contained in:
@@ -34,12 +34,14 @@ func (h *Handlers) AddHook(w http.ResponseWriter, r *http.Request) {
|
||||
h.config.Hooks = h.hookMgr.ListHooks()
|
||||
if h.configPath != "" {
|
||||
if err := config.Save(h.configPath, h.config); err != nil {
|
||||
logging.Error("Failed to save config", "error", err)
|
||||
logging.Error("Failed to save config after adding hook", "hook_id", hook.ID, "error", err)
|
||||
} else {
|
||||
logging.Info("Config saved after adding hook", "hook_id", hook.ID)
|
||||
}
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
writeJSON(w, map[string]string{"status": "ok"})
|
||||
writeJSON(w, map[string]string{"status": "ok", "hook_id": hook.ID})
|
||||
}
|
||||
|
||||
// RemoveHook removes a hook from the system
|
||||
@@ -66,7 +68,9 @@ func (h *Handlers) RemoveHook(w http.ResponseWriter, r *http.Request) {
|
||||
h.config.Hooks = h.hookMgr.ListHooks()
|
||||
if h.configPath != "" {
|
||||
if err := config.Save(h.configPath, h.config); err != nil {
|
||||
logging.Error("Failed to save config", "error", err)
|
||||
logging.Error("Failed to save config after removing hook", "hook_id", req.ID, "error", err)
|
||||
} else {
|
||||
logging.Info("Config saved after removing hook", "hook_id", req.ID)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user