Skip to content

Commit

Permalink
[people-picker] user-ids fix for 'me' request (#1397)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikola Metulev <[email protected]>
  • Loading branch information
vogtn and nmetulev authored Nov 18, 2021
1 parent 9e72254 commit 9a3d2c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -965,10 +965,10 @@ export class MgtPerson extends MgtTemplatedComponent {
) {
this.personDetails;
let image;
if ('personType' in this.personDetails) {
image = await getPersonImage(graph, this.personDetails, MgtPerson.config.useContactApis);
} else {
if ('groupTypes' in this.personDetails) {
image = await getGroupImage(graph, this.personDetails, MgtPerson.config.useContactApis);
} else {
image = await getPersonImage(graph, this.personDetails, MgtPerson.config.useContactApis);
}
if (image) {
this.personDetails.personImage = image;
Expand Down
7 changes: 5 additions & 2 deletions packages/mgt-components/src/graph/graph.user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,11 @@ export async function getUsersForUserIds(graph: IGraph, userIds: string[], searc
peopleDict[id] = user ? user : null;
}
} else if (id !== '') {
batch.get(id, `/users/${id}`, ['user.readbasic.all']);
notInCache.push(id);
if (id.toString() === 'me') {
peopleDict[id] = await getMe(graph);
} else {
batch.get(id, `/users/${id}`, ['user.readbasic.all']);
}
}
}
try {
Expand Down

0 comments on commit 9a3d2c5

Please sign in to comment.