mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +00:00
Move Repo APIFormat to convert package (#13787)
* Move Repo APIFormat to convert package * tweek
This commit is contained in:
parent
2b4a08e962
commit
7ac8a770e1
18 changed files with 201 additions and 193 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/convert"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/routers/api/v1/utils"
|
||||
repo_service "code.gitea.io/gitea/services/repository"
|
||||
|
@ -58,7 +59,7 @@ func ListForks(ctx *context.APIContext) {
|
|||
ctx.Error(http.StatusInternalServerError, "AccessLevel", err)
|
||||
return
|
||||
}
|
||||
apiForks[i] = fork.APIFormat(access)
|
||||
apiForks[i] = convert.ToRepo(fork, access)
|
||||
}
|
||||
ctx.JSON(http.StatusOK, apiForks)
|
||||
}
|
||||
|
@ -125,5 +126,5 @@ func CreateFork(ctx *context.APIContext, form api.CreateForkOption) {
|
|||
}
|
||||
|
||||
//TODO change back to 201
|
||||
ctx.JSON(http.StatusAccepted, fork.APIFormat(models.AccessModeOwner))
|
||||
ctx.JSON(http.StatusAccepted, convert.ToRepo(fork, models.AccessModeOwner))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue