From 742bc36edd92229cf78608af7f950e65f71a0a01 Mon Sep 17 00:00:00 2001 From: Mateusz Reszka Date: Sat, 22 Oct 2022 17:52:48 +0200 Subject: api: support put content (#7114) Co-authored-by: Joe Chen --- internal/route/api/v1/api.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'internal/route/api/v1/api.go') diff --git a/internal/route/api/v1/api.go b/internal/route/api/v1/api.go index f1684691..0a17e657 100644 --- a/internal/route/api/v1/api.go +++ b/internal/route/api/v1/api.go @@ -273,7 +273,9 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("/raw/*", context.RepoRef(), repo.GetRawFile) m.Group("/contents", func() { m.Get("", repo.GetContents) - m.Get("/*", repo.GetContents) + m.Combo("/*"). + Get(repo.GetContents). + Put(bind(repo.PutContentsRequest{}), repo.PutContents) }) m.Get("/archive/*", repo.GetArchive) m.Group("/git", func() { -- cgit v1.2.3