Get week range from server
This commit is contained in:
@@ -29,3 +29,9 @@ func apiReposHandler(w http.ResponseWriter, r *http.Request) {
|
||||
repos := db.OrgRepos(stat.Org)
|
||||
req.respondWith(repos)
|
||||
}
|
||||
|
||||
func apiOrgWeekRangeHandler(w http.ResponseWriter, r *http.Request) {
|
||||
req, stat := parseRequest(w, r)
|
||||
min, max := db.OrgWeekRange(stat.Org)
|
||||
req.respondWith([]int{min, max})
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ func init() {
|
||||
http.HandleFunc("/api/teams", apiTeamsHandler)
|
||||
http.HandleFunc("/api/users", apiUsersHandler)
|
||||
http.HandleFunc("/api/repos", apiReposHandler)
|
||||
http.HandleFunc("/api/weeks", apiOrgWeekRangeHandler)
|
||||
|
||||
http.HandleFunc("/api/stat/orgs/top", statOrgTopHandler)
|
||||
http.HandleFunc("/api/stat/orgs/activity", statOrgActivityHandler)
|
||||
|
||||
Reference in New Issue
Block a user