File tree Expand file tree Collapse file tree
packages/backend/src/network/rest Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,12 +167,7 @@ export class ApiQueryService {
167167 return await this . tournamentService . getTournamentDetail ( tournamentId , currentUser ) ;
168168 }
169169
170- async searchUsers ( req : express . Request , query : string ) : Promise < UserSearchResponse > {
171- const currentUser = await this . authService . getUserFromRequest ( req ) ;
172- if ( ! currentUser ) {
173- throw new ApiRequestError ( 401 , `Sign in with Discord to search for tournament players.` ) ;
174- }
175-
170+ async searchUsers ( query : string ) : Promise < UserSearchResponse > {
176171 const users = await this . authRepository . searchUserProfiles ( query , 10 ) ;
177172 return {
178173 users : users . map ( ( user ) => this . toPublicAccountProfile ( user ) ) . filter ( ( user ) : user is NonNullable < typeof user > => Boolean ( user ) ) ,
Original file line number Diff line number Diff line change @@ -296,7 +296,7 @@ export class ApiRouter {
296296 router . get ( `/users/search` , async ( req , res ) => {
297297 try {
298298 const query = zAdminUserSearchQuery . parse ( req . query ) ;
299- const response : UserSearchResponse = await this . apiQueryService . searchUsers ( req , query . q ) ;
299+ const response : UserSearchResponse = await this . apiQueryService . searchUsers ( query . q ) ;
300300 res . json ( response ) ;
301301 } catch ( error : unknown ) {
302302 if ( error instanceof ApiRequestError ) {
You can’t perform that action at this time.
0 commit comments