fix: File import via collection menu regression
This commit is contained in:
@ -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);
|
||||||
|
Reference in New Issue
Block a user