예제 #1
0
파일: webhook.go 프로젝트: Unknwon/orbiter
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")
}
예제 #2
0
파일: webhook.go 프로젝트: Unknwon/orbiter
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)
}