From 2061840a17cbf5fe81ebbae20c3d898ac57ab4af Mon Sep 17 00:00:00 2001 From: James Jarvis Date: Tue, 7 Jan 2025 10:51:19 -0800 Subject: [PATCH] fix(storage): add options object to list example (#8184) * add options * fix spacing * spaces instead of tabs --- .../build-a-backend/storage/list-files/index.mdx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/pages/[platform]/build-a-backend/storage/list-files/index.mdx b/src/pages/[platform]/build-a-backend/storage/list-files/index.mdx index 13c3370a014..188f37cc3ee 100644 --- a/src/pages/[platform]/build-a-backend/storage/list-files/index.mdx +++ b/src/pages/[platform]/build-a-backend/storage/list-files/index.mdx @@ -67,15 +67,16 @@ If the `pageSize` is set lower than the total file size, a single `list` call on import { list } from 'aws-amplify/storage'; const PAGE_SIZE = 20; -let nextToken = undefined; -//... +let nextToken; +// ... const loadNextPage = async () => { - let response = await list({ + const response = await list({ path: 'photos/', // Alternatively, path: ({ identityId }) => `album/{identityId}/photos/` - pageSize: PAGE_SIZE, - nextToken: nextToken - } + options: { + pageSize: PAGE_SIZE, + nextToken, + }, }); if (response.nextToken) { nextToken = response.nextToken;