Skip to content

Commit 9a3d2c5

Browse files
vogtnnmetulev
andauthored
[people-picker] user-ids fix for 'me' request (#1397)
Co-authored-by: Nikola Metulev <[email protected]>
1 parent 9e72254 commit 9a3d2c5

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

packages/mgt-components/src/components/mgt-person/mgt-person.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -965,10 +965,10 @@ export class MgtPerson extends MgtTemplatedComponent {
965965
) {
966966
this.personDetails;
967967
let image;
968-
if ('personType' in this.personDetails) {
969-
image = await getPersonImage(graph, this.personDetails, MgtPerson.config.useContactApis);
970-
} else {
968+
if ('groupTypes' in this.personDetails) {
971969
image = await getGroupImage(graph, this.personDetails, MgtPerson.config.useContactApis);
970+
} else {
971+
image = await getPersonImage(graph, this.personDetails, MgtPerson.config.useContactApis);
972972
}
973973
if (image) {
974974
this.personDetails.personImage = image;

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,11 @@ export async function getUsersForUserIds(graph: IGraph, userIds: string[], searc
168168
peopleDict[id] = user ? user : null;
169169
}
170170
} else if (id !== '') {
171-
batch.get(id, `/users/${id}`, ['user.readbasic.all']);
172-
notInCache.push(id);
171+
if (id.toString() === 'me') {
172+
peopleDict[id] = await getMe(graph);
173+
} else {
174+
batch.get(id, `/users/${id}`, ['user.readbasic.all']);
175+
}
173176
}
174177
}
175178
try {

0 commit comments

Comments
 (0)