File tree Expand file tree Collapse file tree 1 file changed +16
-17
lines changed
src/pages/[platform]/build-a-backend/storage/list-files Expand file tree Collapse file tree 1 file changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -67,24 +67,23 @@ If the `pageSize` is set lower than the total file size, a single `list` call on
6767import { list } from 'aws-amplify/storage';
6868
6969const PAGE_SIZE = 20;
70- let nextToken = undefined ;
71- //...
70+ let nextToken;
71+ // ...
7272const loadNextPage = async () => {
73- let response = await list({
74- path: 'photos/',
75- // Alternatively, path: ({ identityId }) => ` album/ {identityId}/ photos/ `
76- options: {
77- pageSize: PAGE_SIZE,
78- nextToken: nextToken
79- }
80- }
81- });
82- if (response.nextToken) {
83- nextToken = response.nextToken;
84- } else {
85- nextToken = undefined;
86- }
87- // render list items from response.items
73+ const response = await list({
74+ path: 'photos/',
75+ // Alternatively, path: ({ identityId }) => ` album/ {identityId}/ photos/ `
76+ options: {
77+ pageSize: PAGE_SIZE,
78+ nextToken,
79+ },
80+ });
81+ if (response.nextToken) {
82+ nextToken = response.nextToken;
83+ } else {
84+ nextToken = undefined;
85+ }
86+ // render list items from response.items
8887};
8988` ` `
9089
You can’t perform that action at this time.
0 commit comments