Skip to content

Commit

Permalink
fix(storage): rename list request path to prefix (#11997)
Browse files Browse the repository at this point in the history
fix(storage): list request would expose prefix instead of path

Co-authored-by: Sridhar <[email protected]>
Co-authored-by: Aaron S <[email protected]>
  • Loading branch information
3 people authored Sep 11, 2023
1 parent 54730e2 commit bc302ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/storage/__tests__/providers/s3/apis/list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('list API', () => {
expect.assertions(4);
const customPageSize = 5;
const response = await list({
path: 'listWithTokenResultsPath',
prefix: 'listWithTokenResultsPath',
options: {
accessLevel: 'guest',
pageSize: customPageSize,
Expand All @@ -148,7 +148,7 @@ describe('list API', () => {
mockListObjectsV2ApiWithPages(3);

const result = await list({
path: 'listALLResultsPath',
prefix: 'listALLResultsPath',
options: { accessLevel: 'guest', listAll: true },
});

Expand Down Expand Up @@ -185,7 +185,7 @@ describe('list API', () => {

expect.assertions(3);
let response = await list({
path: 'emptyListResultsPath',
prefix: 'emptyListResultsPath',
options: {
accessLevel: 'guest',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/storage/src/providers/s3/apis/internal/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const list = async (
| StorageListRequest<StorageListAllOptions>
| StorageListRequest<StorageListPaginateOptions>
): Promise<S3ListAllResult | S3ListPaginateResult> => {
const { options = {}, path = '' } = listRequest ?? {};
const { options = {}, prefix: path = '' } = listRequest ?? {};
const {
s3Config,
bucket,
Expand Down
2 changes: 1 addition & 1 deletion packages/storage/src/types/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type StorageOperationRequest<Options extends StorageOptions> = {
export type StorageListRequest<
Options extends StorageListAllOptions | StorageListPaginateOptions
> = {
path?: string;
prefix?: string;
options?: Options;
};

Expand Down

0 comments on commit bc302ee

Please sign in to comment.