diff --git a/components/FileListing.tsx b/components/FileListing.tsx index 724f048..efd4131 100644 --- a/components/FileListing.tsx +++ b/components/FileListing.tsx @@ -123,7 +123,6 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) = ) } - const resp = data.data const fileIsImage = (fileName: string) => { const fileExtension = getExtension(fileName) if (hasKey(extensions, fileExtension)) { @@ -134,8 +133,8 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) = return false } - if ('folder' in resp) { - const { children } = resp + if ('folderData' in data) { + const { value } = data.folderData // Image preview rendering preparations const imagesInFolder: ImageDecorator[] = [] @@ -146,7 +145,7 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) = let renderReadme = false let readmeFile = null - children.forEach((c: any) => { + value.forEach((c: any) => { if (fileIsImage(c.name)) { imagesInFolder.push({ src: c['@microsoft.graph.downloadUrl'], @@ -218,7 +217,7 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) = /> )} - {children.map((c: any) => ( + {value.map((c: any) => (