diff options
author | qwerty287 <80460567+qwerty287@users.noreply.github.com> | 2023-03-28 19:23:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-28 13:23:25 -0400 |
commit | 3cab9c6b0c050bfcb9f2f067e7dc1b0242875254 (patch) | |
tree | 0a781efb66090c244fece965cd7dfe3c57c6cb5e /routers/api/v1/api.go | |
parent | 85e8c837b8472ec20e657d2a7ebc6c78c04bffae (diff) | |
download | gitea-3cab9c6b0c050bfcb9f2f067e7dc1b0242875254.tar.gz gitea-3cab9c6b0c050bfcb9f2f067e7dc1b0242875254.zip |
Add API to manage issue dependencies (#17935)
Adds API endpoints to manage issue/PR dependencies
* `GET /repos/{owner}/{repo}/issues/{index}/blocks` List issues that are
blocked by this issue
* `POST /repos/{owner}/{repo}/issues/{index}/blocks` Block the issue
given in the body by the issue in path
* `DELETE /repos/{owner}/{repo}/issues/{index}/blocks` Unblock the issue
given in the body by the issue in path
* `GET /repos/{owner}/{repo}/issues/{index}/dependencies` List an
issue's dependencies
* `POST /repos/{owner}/{repo}/issues/{index}/dependencies` Create a new
issue dependencies
* `DELETE /repos/{owner}/{repo}/issues/{index}/dependencies` Remove an
issue dependency
Closes https://github.com/go-gitea/gitea/issues/15393
Closes #22115
Co-authored-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r-- | routers/api/v1/api.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 8fd824640f..7d1980baeb 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -1026,6 +1026,14 @@ func Routes(ctx gocontext.Context) *web.Route { Patch(reqToken(auth_model.AccessTokenScopeRepo), mustNotBeArchived, bind(api.EditAttachmentOptions{}), repo.EditIssueAttachment). Delete(reqToken(auth_model.AccessTokenScopeRepo), mustNotBeArchived, repo.DeleteIssueAttachment) }, mustEnableAttachments) + m.Combo("/dependencies"). + Get(repo.GetIssueDependencies). + Post(reqToken(auth_model.AccessTokenScopeRepo), mustNotBeArchived, bind(api.IssueMeta{}), repo.CreateIssueDependency). + Delete(reqToken(auth_model.AccessTokenScopeRepo), mustNotBeArchived, bind(api.IssueMeta{}), repo.RemoveIssueDependency) + m.Combo("/blocks"). + Get(repo.GetIssueBlocks). + Post(reqToken(auth_model.AccessTokenScopeRepo), bind(api.IssueMeta{}), repo.CreateIssueBlocking). + Delete(reqToken(auth_model.AccessTokenScopeRepo), bind(api.IssueMeta{}), repo.RemoveIssueBlocking) }) }, mustEnableIssuesOrPulls) m.Group("/labels", func() { |