aboutsummaryrefslogtreecommitdiff
path: root/modules/context/api.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-25 18:04:02 -0400
committerUnknwon <u@gogs.io>2016-03-25 18:04:02 -0400
commitb1d41cfa603aee63711fbc23bb02fced5a4c54e3 (patch)
treedc79e8f9c8dec5ab324b27d10108667e7b4d9090 /modules/context/api.go
parent9dda9ef07c03000cb961a80e3c75459c58602009 (diff)
#1692 add admin APIs to add/remove a user from teams
Diffstat (limited to 'modules/context/api.go')
-rw-r--r--modules/context/api.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/context/api.go b/modules/context/api.go
index 8d036be9..770daa3a 100644
--- a/modules/context/api.go
+++ b/modules/context/api.go
@@ -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)