mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
Some repository refactors (#17950)
* some repository refactors * remove unnecessary code * Fix test * Remove unnecessary banner
This commit is contained in:
parent
0a7e8327a0
commit
5723240490
88 changed files with 1363 additions and 1388 deletions
|
@ -8,7 +8,7 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
)
|
||||
|
@ -28,7 +28,7 @@ func TopicsPost(ctx *context.Context) {
|
|||
topics = strings.Split(topicsStr, ",")
|
||||
}
|
||||
|
||||
validTopics, invalidTopics := models.SanitizeAndValidateTopics(topics)
|
||||
validTopics, invalidTopics := repo_model.SanitizeAndValidateTopics(topics)
|
||||
|
||||
if len(validTopics) > 25 {
|
||||
ctx.JSON(http.StatusUnprocessableEntity, map[string]interface{}{
|
||||
|
@ -46,7 +46,7 @@ func TopicsPost(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
err := models.SaveTopics(ctx.Repo.Repository.ID, validTopics...)
|
||||
err := repo_model.SaveTopics(ctx.Repo.Repository.ID, validTopics...)
|
||||
if err != nil {
|
||||
log.Error("SaveTopics failed: %v", err)
|
||||
ctx.JSON(http.StatusInternalServerError, map[string]interface{}{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue