mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
Use context parameter in services/repository (#23186)
Use context parameter in `services/repository`. And use `cache.WithCacheContext(ctx)` to generate push action history feeds. Fix #23160
This commit is contained in:
@ -45,7 +45,7 @@ func ListUnadoptedRepositories(ctx *context.APIContext) {
|
||||
if listOptions.Page == 0 {
|
||||
listOptions.Page = 1
|
||||
}
|
||||
repoNames, count, err := repo_service.ListUnadoptedRepositories(ctx.FormString("query"), &listOptions)
|
||||
repoNames, count, err := repo_service.ListUnadoptedRepositories(ctx, ctx.FormString("query"), &listOptions)
|
||||
if err != nil {
|
||||
ctx.InternalServerError(err)
|
||||
return
|
||||
@ -109,7 +109,7 @@ func AdoptRepository(ctx *context.APIContext) {
|
||||
ctx.NotFound()
|
||||
return
|
||||
}
|
||||
if _, err := repo_service.AdoptRepository(ctx.Doer, ctxUser, repo_module.CreateRepoOptions{
|
||||
if _, err := repo_service.AdoptRepository(ctx, ctx.Doer, ctxUser, repo_module.CreateRepoOptions{
|
||||
Name: repoName,
|
||||
IsPrivate: true,
|
||||
}); err != nil {
|
||||
@ -172,7 +172,7 @@ func DeleteUnadoptedRepository(ctx *context.APIContext) {
|
||||
return
|
||||
}
|
||||
|
||||
if err := repo_service.DeleteUnadoptedRepository(ctx.Doer, ctxUser, repoName); err != nil {
|
||||
if err := repo_service.DeleteUnadoptedRepository(ctx, ctx.Doer, ctxUser, repoName); err != nil {
|
||||
ctx.InternalServerError(err)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user