Skip to content

Commit

Permalink
fix: add userPrincipalName as an option in findPeople query (#3206)
Browse files Browse the repository at this point in the history
This allows to have another parameter for searching people in /users endpoint when the user is not licensed

Signed-off-by: Musale Martin <martinmusale@microsoft.com>
  • Loading branch information
musale authored Jun 10, 2024
1 parent a526ff5 commit 97fe1c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mgt-components/src/graph/graph.user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export const findUsers = async (graph: IGraph, query: string, top = 10, userFilt
const encodedQuery = `${query.replace(/#/g, '%2523')}`;
const graphBuilder = graph
.api('users')
.search(`"displayName:${encodedQuery}" OR "mail:${encodedQuery}"`)
.search(`"displayName:${encodedQuery}" OR "mail:${encodedQuery}" OR "userPrincipalName: ${encodedQuery}"`)
.header('ConsistencyLevel', 'eventual')
.count(true);
let graphResult: CollectionResponse<User>;
Expand Down

0 comments on commit 97fe1c0

Please sign in to comment.