pagination loading of subscription and databaseaccounts (#1877)

This commit is contained in:
sunghyunkang1111 2024-06-21 14:28:00 -05:00 committed by GitHub
parent fe892dcc62
commit 28db549fa1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 10 deletions

View File

@ -52,11 +52,17 @@ export async function fetchDatabaseAccountsFromGraph(
const body = {
query: databaseAccountsQuery,
subscriptions: [subscriptionId],
...(skipToken && {
options: {
$skipToken: skipToken,
} as QueryRequestOptions,
}),
...(skipToken
? {
options: {
$skipToken: skipToken,
} as QueryRequestOptions,
}
: {
options: {
$top: 150,
} as QueryRequestOptions,
}),
};
const response = await fetch(managementResourceGraphAPIURL, {

View File

@ -51,11 +51,17 @@ export async function fetchSubscriptionsFromGraph(accessToken: string): Promise<
do {
const body = {
query: subscriptionsQuery,
...(skipToken && {
options: {
$skipToken: skipToken,
} as QueryRequestOptions,
}),
...(skipToken
? {
options: {
$skipToken: skipToken,
} as QueryRequestOptions,
}
: {
options: {
$top: 150,
} as QueryRequestOptions,
}),
};
const response = await fetch(managementResourceGraphAPIURL, {