summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/user/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/user/user.go')
-rw-r--r--routers/api/v1/user/user.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go
index bba7b7a5d1..56e6ad8879 100644
--- a/routers/api/v1/user/user.go
+++ b/routers/api/v1/user/user.go
@@ -56,7 +56,7 @@ func Search(ctx *context.APIContext) {
listOptions := utils.GetListOptions(ctx)
users, maxResults, err := user_model.SearchUsers(&user_model.SearchUserOptions{
- Actor: ctx.User,
+ Actor: ctx.Doer,
Keyword: ctx.FormTrim("q"),
UID: ctx.FormInt64("uid"),
Type: user_model.UserTypeIndividual,
@@ -75,7 +75,7 @@ func Search(ctx *context.APIContext) {
ctx.JSON(http.StatusOK, map[string]interface{}{
"ok": true,
- "data": convert.ToUsers(ctx.User, users),
+ "data": convert.ToUsers(ctx.Doer, users),
})
}
@@ -104,12 +104,12 @@ func GetInfo(ctx *context.APIContext) {
return
}
- if !models.IsUserVisibleToViewer(u, ctx.User) {
+ if !models.IsUserVisibleToViewer(u, ctx.Doer) {
// fake ErrUserNotExist error message to not leak information about existence
ctx.NotFound("GetUserByName", user_model.ErrUserNotExist{Name: ctx.Params(":username")})
return
}
- ctx.JSON(http.StatusOK, convert.ToUser(u, ctx.User))
+ ctx.JSON(http.StatusOK, convert.ToUser(u, ctx.Doer))
}
// GetAuthenticatedUser get current user's information
@@ -123,7 +123,7 @@ func GetAuthenticatedUser(ctx *context.APIContext) {
// "200":
// "$ref": "#/responses/User"
- ctx.JSON(http.StatusOK, convert.ToUser(ctx.User, ctx.User))
+ ctx.JSON(http.StatusOK, convert.ToUser(ctx.Doer, ctx.Doer))
}
// GetUserHeatmapData is the handler to get a users heatmap
@@ -150,7 +150,7 @@ func GetUserHeatmapData(ctx *context.APIContext) {
return
}
- heatmap, err := models.GetUserHeatmapDataByUser(user, ctx.User)
+ heatmap, err := models.GetUserHeatmapDataByUser(user, ctx.Doer)
if err != nil {
ctx.Error(http.StatusInternalServerError, "GetUserHeatmapDataByUser", err)
return