Implement a few team endpoints for APIv4 (#5296)

* Implement GET /teams/{team_id} endpoint for APIv4

* Implement GET /users/{user_id}/teams endpoint for APIv4

* Implement GET /teams/{team_id}/members/{user_id} endpoint for APIv4
Этот коммит содержится в:
Joram Wilander
2017-02-07 08:57:41 -08:00
коммит произвёл Harrison Healey
родитель d91fea6518
Коммит ba18374bd1
7 изменённых файлов: 247 добавлений и 11 удалений

Просмотреть файл

@@ -94,7 +94,7 @@ func InitApi(full bool) {
BaseRoutes.UserByEmail = BaseRoutes.Users.PathPrefix("/email/{email}").Subrouter()
BaseRoutes.Teams = BaseRoutes.ApiRoot.PathPrefix("/teams").Subrouter()
BaseRoutes.TeamsForUser = BaseRoutes.Users.PathPrefix("/teams").Subrouter()
BaseRoutes.TeamsForUser = BaseRoutes.User.PathPrefix("/teams").Subrouter()
BaseRoutes.Team = BaseRoutes.Teams.PathPrefix("/{team_id:[A-Za-z0-9]+}").Subrouter()
BaseRoutes.TeamByName = BaseRoutes.Teams.PathPrefix("/name/{team_name:[A-Za-z0-9_-]+}").Subrouter()
BaseRoutes.TeamMembers = BaseRoutes.Team.PathPrefix("/members").Subrouter()
@@ -141,11 +141,10 @@ func InitApi(full bool) {
InitTeam()
InitChannel()
app.Srv.Router.Handle("/api/v4/{anything:.*}", http.HandlerFunc(Handle404))
// REMOVE CONDITION WHEN APIv3 REMOVED
if full {
// 404 on any api route before web.go has a chance to serve it
app.Srv.Router.Handle("/api/{anything:.*}", http.HandlerFunc(Handle404))
utils.InitHTML()
app.InitEmailBatching()