From 288531c9f00e696b13c0023e8bd06f789caa2a9e Mon Sep 17 00:00:00 2001 From: Andrew Hahn Date: Wed, 10 Jul 2024 18:32:26 -0400 Subject: [PATCH] docs(storage): add new docs for subpath strategy --- .../build-a-backend/storage/list-files/index.mdx | 7 +++---- 1 file changed, 3 insertions(+), 4 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 3eb8a2613a3..21778f581e9 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 @@ -129,7 +129,7 @@ This can be accomplished with the `subpathStrategy` option: ```ts title="src/main.ts" import { list } from "aws-amplify/storage"; -const result = await list({ +const result = await list({ path: "photos/", options:{ subpathStrategy: { strategy:'exclude' } @@ -366,9 +366,7 @@ Future listAlbum() async { options: StorageListOptions( pageSize: 50, nextToken: nextToken, - pluginOptions: const S3ListPluginOptions( - excludeSubPaths: true, - ), + subpathStrategy: const SubpathStrategy.exclude(), ), ).result; safePrint('Listed items: ${result.items}'); @@ -397,6 +395,7 @@ Future listAllUnderPublicPath() async { path: const StoragePath.fromString('public/'), options: const StorageListOptions( pluginOptions: S3ListPluginOptions.listAll(), + subpathStrategy: SubpathStrategy.include(), ), ).result; safePrint('Listed items: ${result.items}');