mirror of
https://github.com/harness/drone.git
synced 2025-05-05 15:32:56 +00:00
fix: [CODE-3460]: Update API path for pr update target branch (#3662)
* Revert to PUT for HTTP method * Merge remote-tracking branch 'origin/main' into dd/target-branch-handler * Update API path for pr update target branch
This commit is contained in:
parent
646cb57578
commit
a1969452b8
@ -779,14 +779,14 @@ func pullReqOperations(reflector *openapi3.Reflector) {
|
||||
_ = reflector.SetRequest(&opChangeTargetBranch, struct {
|
||||
pullReqRequest
|
||||
pullreq.ChangeTargetBranchInput
|
||||
}{}, http.MethodPost)
|
||||
}{}, http.MethodPut)
|
||||
_ = reflector.SetJSONResponse(&opChangeTargetBranch, new(types.PullReq), http.StatusOK)
|
||||
_ = reflector.SetJSONResponse(&opChangeTargetBranch, new(usererror.Error), http.StatusBadRequest)
|
||||
_ = reflector.SetJSONResponse(&opChangeTargetBranch, new(usererror.Error), http.StatusInternalServerError)
|
||||
_ = reflector.SetJSONResponse(&opChangeTargetBranch, new(usererror.Error), http.StatusUnauthorized)
|
||||
_ = reflector.SetJSONResponse(&opChangeTargetBranch, new(usererror.Error), http.StatusForbidden)
|
||||
_ = reflector.Spec.AddOperation(http.MethodPut,
|
||||
"/repos/{repo_ref}/pullreq/{pullreq_number}/branch", opChangeTargetBranch)
|
||||
"/repos/{repo_ref}/pullreq/{pullreq_number}/target-branch", opChangeTargetBranch)
|
||||
|
||||
fileViewAdd := openapi3.Operation{}
|
||||
fileViewAdd.WithTags("pullreq")
|
||||
|
@ -696,9 +696,10 @@ func SetupPullReq(r chi.Router, pullreqCtrl *pullreq.Controller) {
|
||||
r.Route("/branch", func(r chi.Router) {
|
||||
r.Post("/", handlerpullreq.HandleRestoreBranch(pullreqCtrl))
|
||||
r.Delete("/", handlerpullreq.HandleDeleteBranch(pullreqCtrl))
|
||||
r.Put("/", handlerpullreq.HandleChangeTargetBranch(pullreqCtrl))
|
||||
})
|
||||
|
||||
r.Put("/target-branch", handlerpullreq.HandleChangeTargetBranch(pullreqCtrl))
|
||||
|
||||
r.Route("/file-views", func(r chi.Router) {
|
||||
r.Put("/", handlerpullreq.HandleFileViewAdd(pullreqCtrl))
|
||||
r.Get("/", handlerpullreq.HandleFileViewList(pullreqCtrl))
|
||||
|
Loading…
x
Reference in New Issue
Block a user