fix: File import via collection menu regression

This commit is contained in:
Tom Moor
2021-02-07 16:13:44 -08:00
parent e2d7d34f30
commit 8e3534dcbc

View File

@ -83,20 +83,19 @@ function CollectionMenu({
try { try {
const file = files[0]; const file = files[0];
const document = await documents.import( const document = await documents.import(file, null, collection.id, {
file, publish: true,
null, });
this.props.collection.id,
{ publish: true }
);
history.push(document.url); history.push(document.url);
} catch (err) { } catch (err) {
ui.showToast(err.message, { ui.showToast(err.message, {
type: "error", type: "error",
}); });
throw err;
} }
}, },
[history, ui, documents] [history, ui, collection.id, documents]
); );
const can = policies.abilities(collection.id); const can = policies.abilities(collection.id);