Exemple #1
0
func Webhooks(ctx *context.Context) {
	ctx.Data["Title"] = "Webhooks"
	ctx.Data["PageIsWebhook"] = true

	webhooks, err := models.QueryWebhooks(models.QueryWebhookOptions{
		Limit: 50,
		Order: "created desc",
	})
	if err != nil {
		ctx.Error(500, err.Error())
		return
	}
	ctx.Data["Webhooks"] = webhooks

	ctx.HTML(200, "webhook/list")
}
Exemple #2
0
func ListWebhooks(ctx *Context) {
	webhooks, err := models.QueryWebhooks(models.QueryWebhookOptions{
		CollectorID: ctx.QueryInt64("collector_id"),
		Owner:       ctx.Query("owner"),
		RepoName:    ctx.Query("repo_name"),
		EventType:   ctx.Query("event_type"),
		Sender:      ctx.Query("sender"),
		After:       ctx.QueryInt64("after"),
		Limit:       ctx.QueryInt64("limit"),
	})
	if err != nil {
		ctx.Error(500, err.Error())
		return
	}

	ctx.JSON(200, webhooks)
}