summaryrefslogtreecommitdiffstats
path: root/routers/org/setting.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/org/setting.go')
-rw-r--r--routers/org/setting.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/routers/org/setting.go b/routers/org/setting.go
index 7a76199502..a15af26d43 100644
--- a/routers/org/setting.go
+++ b/routers/org/setting.go
@@ -105,9 +105,11 @@ func SettingsDelete(ctx *middleware.Context) {
ctx.HTML(200, SETTINGS_DELETE)
}
-func SettingsHooks(ctx *middleware.Context) {
+func Webhooks(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Tr("org.settings")
ctx.Data["PageIsSettingsHooks"] = true
+ ctx.Data["BaseLink"] = ctx.Org.OrgLink
+ ctx.Data["Description"] = ctx.Tr("org.settings.hooks_desc")
// Delete web hook.
remove := com.StrTo(ctx.Query("remove")).MustInt64()
@@ -130,3 +132,15 @@ func SettingsHooks(ctx *middleware.Context) {
ctx.Data["Webhooks"] = ws
ctx.HTML(200, SETTINGS_HOOKS)
}
+
+func DeleteWebhook(ctx *middleware.Context) {
+ if err := models.DeleteWebhook(ctx.QueryInt64("id")); err != nil {
+ ctx.Flash.Error("DeleteWebhook: " + err.Error())
+ } else {
+ ctx.Flash.Success(ctx.Tr("repo.settings.webhook_deletion_success"))
+ }
+
+ ctx.JSON(200, map[string]interface{}{
+ "redirect": ctx.Org.OrgLink + "/settings/hooks",
+ })
+}