forked from kevadesu/forgejo
api: able to create repo and fix #726
- POST /user/repos - POST /org/:org/repos
This commit is contained in:
parent
2f3a7e53cb
commit
ac4a10456e
14 changed files with 162 additions and 81 deletions
|
@ -12,8 +12,18 @@ import (
|
|||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
// ToApiUser converts user to API format.
|
||||
func ToApiUser(u *models.User) *api.User {
|
||||
return &api.User{
|
||||
Id: u.Id,
|
||||
UserName: u.Name,
|
||||
AvatarUrl: string(setting.Protocol) + u.AvatarLink(),
|
||||
}
|
||||
}
|
||||
|
||||
func SearchUsers(ctx *middleware.Context) {
|
||||
opt := models.SearchOption{
|
||||
Keyword: ctx.Query("q"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue