mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 10:07:22 +00:00
@ -53,7 +53,7 @@ func ListTopics(ctx *context.APIContext) {
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
}
|
||||
|
||||
topics, total, err := repo_model.FindTopics(opts)
|
||||
topics, total, err := repo_model.FindTopics(ctx, opts)
|
||||
if err != nil {
|
||||
ctx.InternalServerError(err)
|
||||
return
|
||||
@ -120,7 +120,7 @@ func UpdateTopics(ctx *context.APIContext) {
|
||||
return
|
||||
}
|
||||
|
||||
err := repo_model.SaveTopics(ctx.Repo.Repository.ID, validTopics...)
|
||||
err := repo_model.SaveTopics(ctx, ctx.Repo.Repository.ID, validTopics...)
|
||||
if err != nil {
|
||||
log.Error("SaveTopics failed: %v", err)
|
||||
ctx.InternalServerError(err)
|
||||
@ -172,7 +172,7 @@ func AddTopic(ctx *context.APIContext) {
|
||||
}
|
||||
|
||||
// Prevent adding more topics than allowed to repo
|
||||
count, err := repo_model.CountTopics(&repo_model.FindTopicOptions{
|
||||
count, err := repo_model.CountTopics(ctx, &repo_model.FindTopicOptions{
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
})
|
||||
if err != nil {
|
||||
@ -187,7 +187,7 @@ func AddTopic(ctx *context.APIContext) {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = repo_model.AddTopic(ctx.Repo.Repository.ID, topicName)
|
||||
_, err = repo_model.AddTopic(ctx, ctx.Repo.Repository.ID, topicName)
|
||||
if err != nil {
|
||||
log.Error("AddTopic failed: %v", err)
|
||||
ctx.InternalServerError(err)
|
||||
@ -238,7 +238,7 @@ func DeleteTopic(ctx *context.APIContext) {
|
||||
return
|
||||
}
|
||||
|
||||
topic, err := repo_model.DeleteTopic(ctx.Repo.Repository.ID, topicName)
|
||||
topic, err := repo_model.DeleteTopic(ctx, ctx.Repo.Repository.ID, topicName)
|
||||
if err != nil {
|
||||
log.Error("DeleteTopic failed: %v", err)
|
||||
ctx.InternalServerError(err)
|
||||
@ -287,7 +287,7 @@ func TopicSearch(ctx *context.APIContext) {
|
||||
ListOptions: utils.GetListOptions(ctx),
|
||||
}
|
||||
|
||||
topics, total, err := repo_model.FindTopics(opts)
|
||||
topics, total, err := repo_model.FindTopics(ctx, opts)
|
||||
if err != nil {
|
||||
ctx.InternalServerError(err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user