mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	@@ -26,7 +26,7 @@ func ListOwnerHooks(ctx *context.APIContext, owner *user_model.User) {
 | 
			
		||||
		OwnerID:     owner.ID,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	count, err := webhook.CountWebhooksByOpts(opts)
 | 
			
		||||
	count, err := webhook.CountWebhooksByOpts(ctx, opts)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		ctx.InternalServerError(err)
 | 
			
		||||
		return
 | 
			
		||||
@@ -53,7 +53,7 @@ func ListOwnerHooks(ctx *context.APIContext, owner *user_model.User) {
 | 
			
		||||
 | 
			
		||||
// GetOwnerHook gets an user or organization webhook. Errors are written to ctx.
 | 
			
		||||
func GetOwnerHook(ctx *context.APIContext, ownerID, hookID int64) (*webhook.Webhook, error) {
 | 
			
		||||
	w, err := webhook.GetWebhookByOwnerID(ownerID, hookID)
 | 
			
		||||
	w, err := webhook.GetWebhookByOwnerID(ctx, ownerID, hookID)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		if webhook.IsErrWebhookNotExist(err) {
 | 
			
		||||
			ctx.NotFound()
 | 
			
		||||
@@ -68,7 +68,7 @@ func GetOwnerHook(ctx *context.APIContext, ownerID, hookID int64) (*webhook.Webh
 | 
			
		||||
// GetRepoHook get a repo's webhook. If there is an error, write to `ctx`
 | 
			
		||||
// accordingly and return the error
 | 
			
		||||
func GetRepoHook(ctx *context.APIContext, repoID, hookID int64) (*webhook.Webhook, error) {
 | 
			
		||||
	w, err := webhook.GetWebhookByRepoID(repoID, hookID)
 | 
			
		||||
	w, err := webhook.GetWebhookByRepoID(ctx, repoID, hookID)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		if webhook.IsErrWebhookNotExist(err) {
 | 
			
		||||
			ctx.NotFound()
 | 
			
		||||
@@ -392,7 +392,7 @@ func editHook(ctx *context.APIContext, form *api.EditHookOption, w *webhook.Webh
 | 
			
		||||
		w.IsActive = *form.Active
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if err := webhook.UpdateWebhook(w); err != nil {
 | 
			
		||||
	if err := webhook.UpdateWebhook(ctx, w); err != nil {
 | 
			
		||||
		ctx.Error(http.StatusInternalServerError, "UpdateWebhook", err)
 | 
			
		||||
		return false
 | 
			
		||||
	}
 | 
			
		||||
@@ -401,7 +401,7 @@ func editHook(ctx *context.APIContext, form *api.EditHookOption, w *webhook.Webh
 | 
			
		||||
 | 
			
		||||
// DeleteOwnerHook deletes the hook owned by the owner.
 | 
			
		||||
func DeleteOwnerHook(ctx *context.APIContext, owner *user_model.User, hookID int64) {
 | 
			
		||||
	if err := webhook.DeleteWebhookByOwnerID(owner.ID, hookID); err != nil {
 | 
			
		||||
	if err := webhook.DeleteWebhookByOwnerID(ctx, owner.ID, hookID); err != nil {
 | 
			
		||||
		if webhook.IsErrWebhookNotExist(err) {
 | 
			
		||||
			ctx.NotFound()
 | 
			
		||||
		} else {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user