mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
#1692 add admin APIs to add/remove a user from teams
This commit is contained in:
@@ -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
|
||||
}
|
Reference in New Issue
Block a user