Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Commit 5ea12cb

Browse files
committed
feat: Reverse admin check in globalSearch to retrieve public profiles for non-admin users
1 parent a62cf95 commit 5ea12cb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

dist/controllers/SearchController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ let SearchController = class SearchController {
5353
? await this.userService.adminSearchUsers(query)
5454
: await this.userService.searchUsersByUsername(query);
5555
const detailledUsers = await Promise.all(users.map(async (user) => {
56-
const publicProfile = admin ?
56+
const publicProfile = !admin ?
5757
await this.userService.getUserWithPublicProfile(user.user_id) :
5858
await this.userService.adminGetUserWithProfile(user.user_id);
5959
return { id: user.user_id, ...publicProfile };

src/controllers/SearchController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class SearchController {
5959

6060
const detailledUsers = await Promise.all(
6161
users.map(async (user: PublicUser & UserExtensions) => {
62-
const publicProfile = admin ?
62+
const publicProfile = !admin ?
6363
await this.userService.getUserWithPublicProfile(user.user_id):
6464
await this.userService.adminGetUserWithProfile(user.user_id);
6565
return { id: user.user_id, ...publicProfile };

0 commit comments

Comments
 (0)