|
|
|
@ -55,7 +55,7 @@ class HiveUserController extends SiteController {
|
|
|
|
|
const { user: userService } = this.dtp.services;
|
|
|
|
|
try {
|
|
|
|
|
userId = mongoose.Types.ObjectId(userId);
|
|
|
|
|
res.locals.userProfile = await userService.getUserProfile(userId);
|
|
|
|
|
res.locals.userProfile = await userService.getLocalUserProfile(userId);
|
|
|
|
|
if (!res.locals.userProfile) {
|
|
|
|
|
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.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) => {
|
|
|
|
|
const apiUser = userService.filterUserObject(user);
|
|
|
|
|
apiUser.picture.large = `/image/${user.picture.large}`;
|
|
|
|
|