Skip to content

Commit 10a5ecf

Browse files
committed
fix name and comment
1 parent 4888b61 commit 10a5ecf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

routers/web/repo/code_frequency.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ func CodeFrequency(ctx *context.Context) {
2727
ctx.HTML(http.StatusOK, tplCodeFrequency)
2828
}
2929

30-
// ContributorStats returns JSON of code contributor stats data
31-
func ContributorStats(ctx *context.Context) {
30+
// CodeFrequencyData returns JSON of code frequency data
31+
func CodeFrequencyData(ctx *context.Context) {
3232
if contributorStats, err := contributors_service.GetContributorStats(ctx, ctx.Cache, ctx.Repo.Repository, ctx.Repo.Repository.DefaultBranch); err != nil {
3333
if errors.Is(err, contributors_service.ErrAwaitGeneration) {
3434
ctx.Status(http.StatusAccepted)
3535
return
3636
}
37-
ctx.ServerError("ContributorStats", err)
37+
ctx.ServerError("GetContributorStats", err)
3838
} else {
3939
ctx.JSON(http.StatusOK, contributorStats["total"].Weeks)
4040
}

routers/web/web.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,11 +1484,11 @@ func registerRoutes(m *web.Router) {
14841484
})
14851485
m.Group("/code-frequency", func() {
14861486
m.Get("", repo.CodeFrequency)
1487-
m.Get("/data", repo.ContributorStats)
1487+
m.Get("/data", repo.CodeFrequencyData)
14881488
})
14891489
m.Group("/recent-commits", func() {
14901490
m.Get("", repo.RecentCommits)
1491-
m.Get("/data", repo.ContributorStats)
1491+
m.Get("/data", repo.CodeFrequencyData) // "recent-commits" also uses the same data as "code-frequency"
14921492
})
14931493
}, reqUnitCodeReader)
14941494
},

0 commit comments

Comments
 (0)