Skip to content

Commit

Permalink
fix (@aws-amplify/storage) - track property (aws-amplify#6425)
Browse files Browse the repository at this point in the history
* fix typeError on putEvents
* update test

Co-authored-by: Jordan Ranz <[email protected]>
  • Loading branch information
ashika01 and jordanranz authored Jul 27, 2020
1 parent 28efe52 commit 2009e1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ describe('StorageProvider test', () => {
event: 'getSignedUrl',
data: {
attrs: { method: 'get', result: 'success' },
metrics: null,
},
message: 'Signed URL: url',
},
Expand Down Expand Up @@ -505,7 +504,6 @@ describe('StorageProvider test', () => {
method: 'put',
result: 'success',
},
metrics: null,
},
message: 'Upload success for key',
},
Expand Down Expand Up @@ -627,7 +625,6 @@ describe('StorageProvider test', () => {
event: 'delete',
data: {
attrs: { method: 'remove', result: 'success' },
metrics: null,
},
message: 'Deleted key successfully',
},
Expand Down Expand Up @@ -781,7 +778,6 @@ describe('StorageProvider test', () => {
event: 'list',
data: {
attrs: { method: 'list', result: 'success' },
metrics: null,
},
message: '1 items returned from list operation',
},
Expand Down
6 changes: 5 additions & 1 deletion packages/storage/src/providers/AWSS3Provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ const dispatchStorageEvent = (
message: string
) => {
if (track) {
const data = { attrs };
if (metrics) {
data['metrics'] = metrics;
}
Hub.dispatch(
'storage',
{
event,
data: { attrs, metrics },
data,
message,
},
'Storage',
Expand Down

0 comments on commit 2009e1d

Please sign in to comment.