summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/api.go
diff options
context:
space:
mode:
authorMarc Brückner <marc@ma-br.de>2018-01-16 09:54:13 +0100
committerLauris BH <lauris@nix.lv>2018-01-16 10:54:13 +0200
commit695b10beddc640d333fd5864cb6edb03e540b344 (patch)
tree8bf0e4da05f6fc8b5303780abfe2b36bccf4f8bd /routers/api/v1/api.go
parentcc0c4a30a778b27393923d29fe97b8bc33f345f4 (diff)
downloadgitea-695b10beddc640d333fd5864cb6edb03e540b344.tar.gz
gitea-695b10beddc640d333fd5864cb6edb03e540b344.zip
Fix API-Endpoint release (#3012)
* Fixes API-Endpoint release (#3005) * Using context.ReferencesGitRepo(); doing the same in the PATCH route. * Add release create, get and update test
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r--routers/api/v1/api.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 8a300f9958..6bbc014266 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -463,9 +463,9 @@ func RegisterRoutes(m *macaron.Macaron) {
})
m.Group("/releases", func() {
m.Combo("").Get(repo.ListReleases).
- Post(reqToken(), reqRepoWriter(), bind(api.CreateReleaseOption{}), repo.CreateRelease)
+ Post(reqToken(), reqRepoWriter(), context.ReferencesGitRepo(), bind(api.CreateReleaseOption{}), repo.CreateRelease)
m.Combo("/:id").Get(repo.GetRelease).
- Patch(reqToken(), reqRepoWriter(), bind(api.EditReleaseOption{}), repo.EditRelease).
+ Patch(reqToken(), reqRepoWriter(), context.ReferencesGitRepo(), bind(api.EditReleaseOption{}), repo.EditRelease).
Delete(reqToken(), reqRepoWriter(), repo.DeleteRelease)
})
m.Post("/mirror-sync", reqToken(), reqRepoWriter(), repo.MirrorSync)