Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
list() {
const { path, level, track, identityId } = this.props;
logger.debug('Album path: ' + path);
if (!Storage || typeof Storage.list !== 'function') {
throw new Error('No Storage module found, please ensure @aws-amplify/storage is imported');
}
return Storage.list(path, { level: level? level : 'public', track, identityId })
.then(data => {
logger.debug('album list', data);
this.marshal(data);
})
.catch(err => {
logger.warn(err);
return [];
});
}