diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-17 17:58:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-17 17:58:31 +0800 |
commit | 95d3266bee797cbeb7228d361fe32531737906d2 (patch) | |
tree | 68d90e7ef3e890c1ac311cf79f08cbe12a0dafca /routers/api | |
parent | adda27668b9764f97822e56e0591a6eb22165a83 (diff) | |
download | gitea-95d3266bee797cbeb7228d361fe32531737906d2.tar.gz gitea-95d3266bee797cbeb7228d361fe32531737906d2.zip |
Move user follow and openid into models/user/ (#17613)
* Move UserRedirect into models/user/
* Fix lint & test
* Fix lint
* Fix lint
* remove nolint comment
* Fix lint
* Move user follow and openid into models/user
* Ignore the lint
* Ignore the lint
* Fix test
* ignore stutters lint on UserOpenID
Diffstat (limited to 'routers/api')
-rw-r--r-- | routers/api/v1/user/follower.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/api/v1/user/follower.go b/routers/api/v1/user/follower.go index e273ac6a02..5d66f3bcc3 100644 --- a/routers/api/v1/user/follower.go +++ b/routers/api/v1/user/follower.go @@ -9,6 +9,7 @@ import ( "net/http" "code.gitea.io/gitea/models" + user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/convert" api "code.gitea.io/gitea/modules/structs" @@ -239,7 +240,7 @@ func Follow(ctx *context.APIContext) { if ctx.Written() { return } - if err := models.FollowUser(ctx.User.ID, target.ID); err != nil { + if err := user_model.FollowUser(ctx.User.ID, target.ID); err != nil { ctx.Error(http.StatusInternalServerError, "FollowUser", err) return } @@ -265,7 +266,7 @@ func Unfollow(ctx *context.APIContext) { if ctx.Written() { return } - if err := models.UnfollowUser(ctx.User.ID, target.ID); err != nil { + if err := user_model.UnfollowUser(ctx.User.ID, target.ID); err != nil { ctx.Error(http.StatusInternalServerError, "UnfollowUser", err) return } |