diff options
Diffstat (limited to 'routers/api/v1/user/follower.go')
-rw-r--r-- | routers/api/v1/user/follower.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/api/v1/user/follower.go b/routers/api/v1/user/follower.go index 1eacb89db2..063f68519c 100644 --- a/routers/api/v1/user/follower.go +++ b/routers/api/v1/user/follower.go @@ -18,7 +18,7 @@ import ( func responseAPIUsers(ctx *context.APIContext, users []*user_model.User) { apiUsers := make([]*api.User, len(users)) for i := range users { - apiUsers[i] = convert.ToUser(users[i], ctx.User) + apiUsers[i] = convert.ToUser(users[i], ctx.Doer) } ctx.JSON(http.StatusOK, &apiUsers) } @@ -54,7 +54,7 @@ func ListMyFollowers(ctx *context.APIContext) { // "200": // "$ref": "#/responses/UserList" - listUserFollowers(ctx, ctx.User) + listUserFollowers(ctx, ctx.Doer) } // ListFollowers list the given user's followers @@ -120,7 +120,7 @@ func ListMyFollowing(ctx *context.APIContext) { // "200": // "$ref": "#/responses/UserList" - listUserFollowing(ctx, ctx.User) + listUserFollowing(ctx, ctx.Doer) } // ListFollowing list the users that the given user is following @@ -184,7 +184,7 @@ func CheckMyFollowing(ctx *context.APIContext) { if ctx.Written() { return } - checkUserFollowing(ctx, ctx.User, target.ID) + checkUserFollowing(ctx, ctx.Doer, target.ID) } // CheckFollowing check if one user is following another user @@ -239,7 +239,7 @@ func Follow(ctx *context.APIContext) { if ctx.Written() { return } - if err := user_model.FollowUser(ctx.User.ID, target.ID); err != nil { + if err := user_model.FollowUser(ctx.Doer.ID, target.ID); err != nil { ctx.Error(http.StatusInternalServerError, "FollowUser", err) return } @@ -265,7 +265,7 @@ func Unfollow(ctx *context.APIContext) { if ctx.Written() { return } - if err := user_model.UnfollowUser(ctx.User.ID, target.ID); err != nil { + if err := user_model.UnfollowUser(ctx.Doer.ID, target.ID); err != nil { ctx.Error(http.StatusInternalServerError, "UnfollowUser", err) return } |