From 695b10beddc640d333fd5864cb6edb03e540b344 Mon Sep 17 00:00:00 2001 From: Marc Brückner Date: Tue, 16 Jan 2018 09:54:13 +0100 Subject: 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 --- routers/api/v1/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'routers/api/v1/api.go') 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) -- cgit v1.2.3