Skip to content

Commit

Permalink
update storage identityId path
Browse files Browse the repository at this point in the history
  • Loading branch information
ykethan committed Feb 4, 2025
1 parent 9b77d27 commit 054af05
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import { getUrl } from 'aws-amplify/storage';

const linkToStorageFile = await getUrl({
path: "album/2024/1.jpg",
// Alternatively, path: ({identityId}) => `album/{identityId}/1.jpg`
// Alternatively, path: ({identityId}) => `album/${identityId}/1.jpg`
});
console.log('signed URL: ', linkToStorageFile.url);
console.log('URL expires at: ', linkToStorageFile.expiresAt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { list } from 'aws-amplify/storage';

const result = await list({
path: 'album/photos/',
// Alternatively, path: ({identityId}) => `album/{identityId}/photos/`
// Alternatively, path: ({identityId}) => `album/${identityId}/photos/`
});
```

Expand Down Expand Up @@ -72,7 +72,7 @@ let nextToken;
const loadNextPage = async () => {
const response = await list({
path: 'photos/',
// Alternatively, path: ({ identityId }) => `album/{identityId}/photos/`
// Alternatively, path: ({ identityId }) => `album/${identityId}/photos/`
options: {
pageSize: PAGE_SIZE,
nextToken,
Expand All @@ -93,7 +93,7 @@ import { list } from 'aws-amplify/storage';
const result = await list({
path: 'album/photos/',
// Alternatively, path: ({identityId}) => `album/{identityId}/photos/`,
// Alternatively, path: ({identityId}) => `album/${identityId}/photos/`,
options: {
listAll: true,
}
Expand Down Expand Up @@ -1070,7 +1070,7 @@ import { getProperties } from 'aws-amplify/storage';
try {
const result = await getProperties({
path: 'album/2024/1.jpg',
// Alternatively, path: ({ identityId }) => `album/{identityId}/1.jpg`
// Alternatively, path: ({ identityId }) => `album/${identityId}/1.jpg`
options: {
// Specify a target bucket using name assigned in Amplify Backend
bucket: 'assignedNameInAmplifyBackend'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { remove } from 'aws-amplify/storage';
try {
await remove({
path: 'album/2024/1.jpg',
// Alternatively, path: ({identityId}) => `album/{identityId}/1.jpg`
// Alternatively, path: ({identityId}) => `album/${identityId}/1.jpg`
bucket: 'assignedNameInAmplifyBackend', // Specify a target bucket using name assigned in Amplify Backend
});
} catch (error) {
Expand Down

0 comments on commit 054af05

Please sign in to comment.