mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
refactor: introduce repositories as an additional layer of abstraction to allow for better testability
This commit is contained in:
@ -124,7 +124,13 @@ func (h *SettingsHandler) DeleteCustomRule(w http.ResponseWriter, r *http.Reques
|
||||
ID: uint(ruleId),
|
||||
UserID: user.ID,
|
||||
}
|
||||
h.customRuleSrvc.Delete(rule)
|
||||
|
||||
err = h.customRuleSrvc.Delete(rule)
|
||||
if err != nil {
|
||||
respondAlert(w, "internal server error", "", conf.SettingsTemplate, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
msg := url.QueryEscape("Custom rule deleted successfully.")
|
||||
|
||||
http.Redirect(w, r, fmt.Sprintf("%s/settings?success=%s", h.config.Server.BasePath, msg), http.StatusFound)
|
||||
|
Reference in New Issue
Block a user