package webhook

import (
	"code.gitea.io/gitea/models/db"
	"code.gitea.io/gitea/models/webhook"
)

func GetHookTasksByHookID(hookID int64, page, limit int) ([]*webhook.HookTask, error) {
	tasks := make([]*webhook.HookTask, 0, limit)
	return tasks, db.GetEngine(db.DefaultContext).
		Limit(limit, (page-1)*limit).
		Where("hook_id=?", hookID).
		Desc("id").
		Find(&tasks)
}
