callback > promise
This commit is contained in:
@ -54,19 +54,16 @@ class DropToImport extends Component {
|
||||
}
|
||||
|
||||
for (const file of files) {
|
||||
importFile(
|
||||
{
|
||||
documents: this.props.documents,
|
||||
file,
|
||||
documentId,
|
||||
collectionId,
|
||||
},
|
||||
doc => {
|
||||
if (redirect) {
|
||||
this.props.history.push(doc.url);
|
||||
}
|
||||
}
|
||||
);
|
||||
const doc = await importFile({
|
||||
documents: this.props.documents,
|
||||
file,
|
||||
documentId,
|
||||
collectionId,
|
||||
});
|
||||
|
||||
if (redirect) {
|
||||
this.props.history.push(doc.url);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
// TODO: show error alert.
|
||||
|
Reference in New Issue
Block a user