diff options
author | 6543 <6543@obermui.de> | 2020-12-02 22:38:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 16:38:30 -0500 |
commit | 7ac8a770e1086a50d1fc0a194fe0d7060036fb30 (patch) | |
tree | f3c9e4e92bd158c8ef506ea46163c2dd95a57cfa /routers/api/v1/repo/fork.go | |
parent | 2b4a08e9621e052845062ecd71ebfd37453c0383 (diff) | |
download | gitea-7ac8a770e1086a50d1fc0a194fe0d7060036fb30.tar.gz gitea-7ac8a770e1086a50d1fc0a194fe0d7060036fb30.zip |
Move Repo APIFormat to convert package (#13787)
* Move Repo APIFormat to convert package
* tweek
Diffstat (limited to 'routers/api/v1/repo/fork.go')
-rw-r--r-- | routers/api/v1/repo/fork.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/api/v1/repo/fork.go b/routers/api/v1/repo/fork.go index e6f5f5e630..24700f7a7f 100644 --- a/routers/api/v1/repo/fork.go +++ b/routers/api/v1/repo/fork.go @@ -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)) } |