aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/repo.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-17 02:28:47 -0500
committerUnknwon <u@gogs.io>2015-12-17 02:28:47 -0500
commit9cd16c5b12d093dd694e146d6c845ee4c405c774 (patch)
treed9f1a037ba8ecbc3e5fe2f15f0baec6dec6242b4 /routers/api/v1/repo/repo.go
parent6673dcb0380aa99da25b4d1d68cf129635fe30d9 (diff)
downloadgitea-9cd16c5b12d093dd694e146d6c845ee4c405c774.tar.gz
gitea-9cd16c5b12d093dd694e146d6c845ee4c405c774.zip
#1692 add organization APIs
Diffstat (limited to 'routers/api/v1/repo/repo.go')
-rw-r--r--routers/api/v1/repo/repo.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index c0d897b5d4..7790377910 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/modules/setting"
- to "github.com/gogits/gogs/routers/api/v1/utils"
+ "github.com/gogits/gogs/routers/api/v1/convert"
)
// https://github.com/gogits/go-gogs-client/wiki/Repositories#search-repositories
@@ -97,12 +97,12 @@ func ListMyRepos(ctx *middleware.Context) {
repos := make([]*api.Repository, numOwnRepos+len(accessibleRepos))
for i := range ownRepos {
- repos[i] = to.ApiRepository(ctx.User, ownRepos[i], api.Permission{true, true, true})
+ repos[i] = convert.ToApiRepository(ctx.User, ownRepos[i], api.Permission{true, true, true})
}
i := numOwnRepos
for repo, access := range accessibleRepos {
- repos[i] = to.ApiRepository(repo.Owner, repo, api.Permission{
+ repos[i] = convert.ToApiRepository(repo.Owner, repo, api.Permission{
Admin: access >= models.ACCESS_MODE_ADMIN,
Push: access >= models.ACCESS_MODE_WRITE,
Pull: true,
@@ -139,7 +139,7 @@ func createRepo(ctx *middleware.Context, owner *models.User, opt api.CreateRepoO
return
}
- ctx.JSON(201, to.ApiRepository(owner, repo, api.Permission{true, true, true}))
+ ctx.JSON(201, convert.ToApiRepository(owner, repo, api.Permission{true, true, true}))
}
// https://github.com/gogits/go-gogs-client/wiki/Repositories#create
@@ -239,7 +239,7 @@ func Migrate(ctx *middleware.Context, form auth.MigrateRepoForm) {
}
log.Trace("Repository migrated: %s/%s", ctxUser.Name, form.RepoName)
- ctx.JSON(201, to.ApiRepository(ctxUser, repo, api.Permission{true, true, true}))
+ ctx.JSON(201, convert.ToApiRepository(ctxUser, repo, api.Permission{true, true, true}))
}
func parseOwnerAndRepo(ctx *middleware.Context) (*models.User, *models.Repository) {
@@ -273,7 +273,7 @@ func Get(ctx *middleware.Context) {
return
}
- ctx.JSON(200, to.ApiRepository(owner, repo, api.Permission{true, true, true}))
+ ctx.JSON(200, convert.ToApiRepository(owner, repo, api.Permission{true, true, true}))
}
// https://github.com/gogits/go-gogs-client/wiki/Repositories#delete