Get week range from server

This commit is contained in:
2015-03-22 20:23:18 +07:00
parent b172e131e0
commit fc4a95545d
7 changed files with 48 additions and 18 deletions
+6
View File
@@ -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})
}
+1
View File
@@ -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)