forked from forgejo/forgejo
parent
a1b2a11812
commit
f91dbbba98
90 changed files with 434 additions and 464 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue