I've a service to get all users from Azure AD.
public getAllUsers(): Promise<Array<Person>> {
return graph
.users
.select("displayName", "accountEnabled")
.top(25)
.expand("manager")
.get()
.then((results) => {
return results.map((item: any) => {
return {
displayName: item.displayName,
accountEnabled: item.accountEnabled,
manager: item.manager ? item.manager.displayName : ''
};
});
});
}
export class Person {
public displayName: string;
public accountEnabled: number;
public manager: any;
}
I have over 200 users. I use .top to get 25 users per request. And in the response I receive a link to the next request '@odata.nextLink'.
Can you please tell me how can I request this link again while it is coming? And write the results to a common array.