Skip to content

Commit 3d893b2

Browse files
authored
fix: ensure consistency level header present for user search (#3029)
1 parent 156e30e commit 3d893b2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/mgt-components/src/graph/graph.user.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,15 @@ export const findUsers = async (graph: IGraph, query: string, top = 10, userFilt
418418
}
419419

420420
const encodedQuery = `${query.replace(/#/g, '%2523')}`;
421-
const graphBuilder = graph.api('users').search(`"displayName:${encodedQuery}" OR "mail:${encodedQuery}"`);
421+
const graphBuilder = graph
422+
.api('users')
423+
.search(`"displayName:${encodedQuery}" OR "mail:${encodedQuery}"`)
424+
.header('ConsistencyLevel', 'eventual')
425+
.count(true);
422426
let graphResult: CollectionResponse<User>;
423427

424428
if (userFilters !== '') {
425-
graphBuilder.filter(userFilters).header('ConsistencyLevel', 'eventual').count(true);
429+
graphBuilder.filter(userFilters);
426430
}
427431
try {
428432
graphResult = (await graphBuilder.top(top).middlewareOptions(prepScopes(scopes)).get()) as CollectionResponse<User>;

packages/mgt-element/src/utils/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
// THIS FILE IS AUTO GENERATED
99
// ANY CHANGES WILL BE LOST DURING BUILD
1010

11-
export const PACKAGE_VERSION = '3.1.3';
11+
export const PACKAGE_VERSION = '4.0.0';

0 commit comments

Comments
 (0)