aboutsummaryrefslogtreecommitdiff
path: root/internal/route/api/v1/user
diff options
context:
space:
mode:
authorJoe Chen <jc@unknwon.io>2023-02-08 13:55:54 +0800
committerGitHub <noreply@github.com>2023-02-08 13:55:54 +0800
commit8350daf505b837984397679f07ccc2324b4d2451 (patch)
tree19d3bd7b8dc8370a8973614a74537bddc5f618a6 /internal/route/api/v1/user
parent133b9d90441008ee175e1f8e6369e06309e1392a (diff)
refactor(db): merge relation stores into entity stores (#7341)
Diffstat (limited to 'internal/route/api/v1/user')
-rw-r--r--internal/route/api/v1/user/follower.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/route/api/v1/user/follower.go b/internal/route/api/v1/user/follower.go
index d21c6029..9615924c 100644
--- a/internal/route/api/v1/user/follower.go
+++ b/internal/route/api/v1/user/follower.go
@@ -62,7 +62,7 @@ func ListFollowing(c *context.APIContext) {
}
func checkUserFollowing(c *context.APIContext, u *db.User, followID int64) {
- if db.Follows.IsFollowing(c.Req.Context(), u.ID, followID) {
+ if db.Users.IsFollowing(c.Req.Context(), u.ID, followID) {
c.NoContent()
} else {
c.NotFound()
@@ -94,7 +94,7 @@ func Follow(c *context.APIContext) {
if c.Written() {
return
}
- if err := db.Follows.Follow(c.Req.Context(), c.User.ID, target.ID); err != nil {
+ if err := db.Users.Follow(c.Req.Context(), c.User.ID, target.ID); err != nil {
c.Error(err, "follow user")
return
}
@@ -106,7 +106,7 @@ func Unfollow(c *context.APIContext) {
if c.Written() {
return
}
- if err := db.Follows.Unfollow(c.Req.Context(), c.User.ID, target.ID); err != nil {
+ if err := db.Users.Unfollow(c.Req.Context(), c.User.ID, target.ID); err != nil {
c.Error(err, "unfollow user")
return
}