iterate through all pages

This commit is contained in:
a1mery 2023-07-11 00:55:37 +02:00
parent 2dae63f85e
commit 07a667c664
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ export async function _getSiteWebParts(service: IGraphService, siteId: string):
try { try {
const siteWebParts: WebPart[] = []; const siteWebParts: WebPart[] = [];
const sitePages: SitePage[] = await service.GetSitePages(siteId); const sitePages: SitePage[] = await service.GetSitePages(siteId);
for (let i: number = 0; i < sitePages.length - 1; i++) { for (let i: number = 0; i <= sitePages.length - 1; i++) {
const graphWebParts: GraphWebPartCollection | null = await service.GetWebParts(siteId, sitePages[i].id); const graphWebParts: GraphWebPartCollection | null = await service.GetWebParts(siteId, sitePages[i].id);
if (graphWebParts !== null) { if (graphWebParts !== null) {
graphWebParts.value.forEach(siteWebPart => { graphWebParts.value.forEach(siteWebPart => {