|
|
@ -823,7 +823,7 @@ func DismissPullReview(ctx *context.APIContext) { |
|
|
|
// "422":
|
|
|
|
// "422":
|
|
|
|
// "$ref": "#/responses/validationError"
|
|
|
|
// "$ref": "#/responses/validationError"
|
|
|
|
opts := web.GetForm(ctx).(*api.DismissPullReviewOptions) |
|
|
|
opts := web.GetForm(ctx).(*api.DismissPullReviewOptions) |
|
|
|
dismissReview(ctx, opts.Message, true) |
|
|
|
dismissReview(ctx, opts.Message, true, opts.Priors) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// UnDismissPullReview cancel to dismiss a review for a pull request
|
|
|
|
// UnDismissPullReview cancel to dismiss a review for a pull request
|
|
|
@ -863,10 +863,10 @@ func UnDismissPullReview(ctx *context.APIContext) { |
|
|
|
// "$ref": "#/responses/forbidden"
|
|
|
|
// "$ref": "#/responses/forbidden"
|
|
|
|
// "422":
|
|
|
|
// "422":
|
|
|
|
// "$ref": "#/responses/validationError"
|
|
|
|
// "$ref": "#/responses/validationError"
|
|
|
|
dismissReview(ctx, "", false) |
|
|
|
dismissReview(ctx, "", false, false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func dismissReview(ctx *context.APIContext, msg string, isDismiss bool) { |
|
|
|
func dismissReview(ctx *context.APIContext, msg string, isDismiss, dismissPriors bool) { |
|
|
|
if !ctx.Repo.IsAdmin() { |
|
|
|
if !ctx.Repo.IsAdmin() { |
|
|
|
ctx.Error(http.StatusForbidden, "", "Must be repo admin") |
|
|
|
ctx.Error(http.StatusForbidden, "", "Must be repo admin") |
|
|
|
return |
|
|
|
return |
|
|
@ -886,7 +886,7 @@ func dismissReview(ctx *context.APIContext, msg string, isDismiss bool) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_, err := pull_service.DismissReview(ctx, review.ID, ctx.Repo.Repository.ID, msg, ctx.Doer, isDismiss) |
|
|
|
_, err := pull_service.DismissReview(ctx, review.ID, ctx.Repo.Repository.ID, msg, ctx.Doer, isDismiss, dismissPriors) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Error(http.StatusInternalServerError, "pull_service.DismissReview", err) |
|
|
|
ctx.Error(http.StatusInternalServerError, "pull_service.DismissReview", err) |
|
|
|
return |
|
|
|
return |
|
|
|