mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
api: able to create repo and fix #726
- POST /user/repos - POST /org/:org/repos
This commit is contained in:
@@ -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"),
|
||||
|
Reference in New Issue
Block a user