#1692 add admin APIs to add/remove a user from teams
This commit is contained in:
parent
9dda9ef07c
commit
b1d41cfa60
11 changed files with 712 additions and 639 deletions
|
@ -18,6 +18,7 @@ import (
|
|||
|
||||
type APIContext struct {
|
||||
*Context
|
||||
Org *APIOrganization
|
||||
}
|
||||
|
||||
// Error responses error message to client with given message.
|
||||
|
@ -40,6 +41,7 @@ func (ctx *APIContext) Error(status int, title string, obj interface{}) {
|
|||
})
|
||||
}
|
||||
|
||||
// SetLinkHeader sets pagination link header by given totol number and page size.
|
||||
func (ctx *APIContext) SetLinkHeader(total, pageSize int) {
|
||||
page := paginater.New(total, pageSize, ctx.QueryInt("page"), 0)
|
||||
links := make([]string, 0, 4)
|
||||
|
|
14
modules/context/api_org.go
Normal file
14
modules/context/api_org.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
// Copyright 2016 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package context
|
||||
|
||||
import (
|
||||
"github.com/gogits/gogs/models"
|
||||
)
|
||||
|
||||
type APIOrganization struct {
|
||||
Organization *models.User
|
||||
Team *models.Team
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue