mirror of
https://github.com/harness/drone.git
synced 2025-05-08 12:11:55 +08:00
CODE-548: Update search to prID
This commit is contained in:
parent
699156d56d
commit
9ebc5c1bea
@ -14,13 +14,16 @@ import (
|
||||
|
||||
// ReviewerDelete deletes reviewer from the reviewerlist for the given PR.
|
||||
func (c *Controller) ReviewerDelete(ctx context.Context, session *auth.Session,
|
||||
repoRef string, prID, reviewerID int64) error {
|
||||
_, err := c.getRepoCheckAccess(ctx, session, repoRef, enum.PermissionRepoEdit)
|
||||
repoRef string, prNum, reviewerID int64) error {
|
||||
|
||||
repo, err := c.getRepoCheckAccess(ctx, session, repoRef, enum.PermissionRepoEdit)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to acquire access to repo: %w", err)
|
||||
}
|
||||
|
||||
err = c.reviewerStore.Delete(ctx, prID, reviewerID)
|
||||
pr, err := c.pullreqStore.FindByNumber(ctx, repo.ID, prNum)
|
||||
|
||||
err = c.reviewerStore.Delete(ctx, pr.ID, reviewerID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to delete reviewer: %w", err)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ func HandleReviewerDelete(pullreqCtrl *pullreq.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
prID, err := request.GetPullReqNumberFromPath(r)
|
||||
prNum, err := request.GetPullReqNumberFromPath(r)
|
||||
if err != nil {
|
||||
render.TranslatedUserError(w, err)
|
||||
return
|
||||
@ -36,7 +36,7 @@ func HandleReviewerDelete(pullreqCtrl *pullreq.Controller) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
err = pullreqCtrl.ReviewerDelete(ctx, session, repoRef, prID, reviewerID)
|
||||
err = pullreqCtrl.ReviewerDelete(ctx, session, repoRef, prNum, reviewerID)
|
||||
if err != nil {
|
||||
render.TranslatedUserError(w, err)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user