2015-03-05 15:25:26 +00:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/localhots/empact/db"
|
|
|
|
)
|
|
|
|
|
2015-03-06 11:18:15 +00:00
|
|
|
func apiOrgsHandler(w http.ResponseWriter, r *http.Request) {
|
2015-03-06 12:36:35 +00:00
|
|
|
login := sessionUser(r)
|
2015-03-05 15:25:26 +00:00
|
|
|
orgs := db.UserOrgs(login)
|
2015-03-06 12:15:35 +00:00
|
|
|
respondWith(w, orgs)
|
2015-03-06 10:56:46 +00:00
|
|
|
}
|
|
|
|
|
2015-03-06 11:18:15 +00:00
|
|
|
func apiTeamsHandler(w http.ResponseWriter, r *http.Request) {
|
2015-03-06 10:56:46 +00:00
|
|
|
teams := db.OrgTeams(r.FormValue("org"))
|
2015-03-06 12:15:35 +00:00
|
|
|
respondWith(w, teams)
|
2015-03-05 15:25:26 +00:00
|
|
|
}
|
2015-03-06 11:18:15 +00:00
|
|
|
|
|
|
|
func apiReposHandler(w http.ResponseWriter, r *http.Request) {
|
|
|
|
repos := db.OrgRepos(r.FormValue("org"))
|
2015-03-06 12:15:35 +00:00
|
|
|
respondWith(w, repos)
|
2015-03-06 11:18:15 +00:00
|
|
|
}
|