mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +00:00
Refactor and fix incorrect comment (#1247)
This commit is contained in:
parent
7d8f9d1c46
commit
ec0ae5d50c
20 changed files with 74 additions and 84 deletions
|
@ -64,7 +64,7 @@ func Search(ctx *context.APIContext) {
|
|||
})
|
||||
return
|
||||
}
|
||||
accessMode, err := models.AccessLevel(ctx.User, repo)
|
||||
accessMode, err := models.AccessLevel(ctx.User.ID, repo)
|
||||
if err != nil {
|
||||
ctx.JSON(500, map[string]interface{}{
|
||||
"ok": false,
|
||||
|
@ -218,7 +218,7 @@ func Migrate(ctx *context.APIContext, form auth.MigrateRepoForm) {
|
|||
// see https://github.com/gogits/go-gogs-client/wiki/Repositories#get
|
||||
func Get(ctx *context.APIContext) {
|
||||
repo := ctx.Repo.Repository
|
||||
access, err := models.AccessLevel(ctx.User, repo)
|
||||
access, err := models.AccessLevel(ctx.User.ID, repo)
|
||||
if err != nil {
|
||||
ctx.Error(500, "GetRepository", err)
|
||||
return
|
||||
|
@ -238,7 +238,7 @@ func GetByID(ctx *context.APIContext) {
|
|||
return
|
||||
}
|
||||
|
||||
access, err := models.AccessLevel(ctx.User, repo)
|
||||
access, err := models.AccessLevel(ctx.User.ID, repo)
|
||||
if err != nil {
|
||||
ctx.Error(500, "GetRepositoryByID", err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue