mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Rename module: middleware -> context
This commit is contained in:
parent
cb1eadc276
commit
514382e2eb
54 changed files with 666 additions and 669 deletions
|
@ -8,11 +8,11 @@ import (
|
|||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
)
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users#list-access-tokens-for-a-user
|
||||
func ListAccessTokens(ctx *middleware.Context) {
|
||||
func ListAccessTokens(ctx *context.Context) {
|
||||
tokens, err := models.ListAccessTokens(ctx.User.Id)
|
||||
if err != nil {
|
||||
ctx.APIError(500, "ListAccessTokens", err)
|
||||
|
@ -27,7 +27,7 @@ func ListAccessTokens(ctx *middleware.Context) {
|
|||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users#create-a-access-token
|
||||
func CreateAccessToken(ctx *middleware.Context, form api.CreateAccessTokenOption) {
|
||||
func CreateAccessToken(ctx *context.Context, form api.CreateAccessTokenOption) {
|
||||
t := &models.AccessToken{
|
||||
UID: ctx.User.Id,
|
||||
Name: form.Name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue