diff options
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 3a539f6ce7..b12cb1374a 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -324,6 +324,13 @@ func mustEnableIssuesOrPulls(ctx *context.Context) { } } +func mustEnableUserHeatmap(ctx *context.Context) { + if !setting.Service.EnableUserHeatmap { + ctx.Status(404) + return + } +} + // RegisterRoutes registers all v1 APIs routes to web application. // FIXME: custom form error response func RegisterRoutes(m *macaron.Macaron) { @@ -348,6 +355,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/:username", func() { m.Get("", user.GetInfo) + m.Get("/heatmap", mustEnableUserHeatmap, user.GetUserHeatmapData) m.Get("/repos", user.ListUserRepos) m.Group("/tokens", func() { |