|
@ -55,7 +55,7 @@ class HiveUserController extends SiteController { |
|
|
const { user: userService } = this.dtp.services; |
|
|
const { user: userService } = this.dtp.services; |
|
|
try { |
|
|
try { |
|
|
userId = mongoose.Types.ObjectId(userId); |
|
|
userId = mongoose.Types.ObjectId(userId); |
|
|
res.locals.userProfile = await userService.getUserProfile(userId); |
|
|
res.locals.userProfile = await userService.getLocalUserProfile(userId); |
|
|
if (!res.locals.userProfile) { |
|
|
if (!res.locals.userProfile) { |
|
|
throw new SiteError(404, 'User profile not found'); |
|
|
throw new SiteError(404, 'User profile not found'); |
|
|
} |
|
|
} |
|
@ -80,7 +80,7 @@ class HiveUserController extends SiteController { |
|
|
|
|
|
|
|
|
res.locals.q = userService.filterUsername(req.query.q); |
|
|
res.locals.q = userService.filterUsername(req.query.q); |
|
|
res.locals.pagination = this.getPaginationParameters(req, 20); |
|
|
res.locals.pagination = this.getPaginationParameters(req, 20); |
|
|
res.locals.userProfiles = await userService.getUserAccounts(res.locals.pagination, res.locals.q); |
|
|
res.locals.userProfiles = await userService.searchLocalUserAccounts(res.locals.pagination, res.locals.q); |
|
|
res.locals.userProfiles = res.locals.userProfiles.map((user) => { |
|
|
res.locals.userProfiles = res.locals.userProfiles.map((user) => { |
|
|
const apiUser = userService.filterUserObject(user); |
|
|
const apiUser = userService.filterUserObject(user); |
|
|
apiUser.picture.large = `/image/${user.picture.large}`; |
|
|
apiUser.picture.large = `/image/${user.picture.large}`; |
|
|