fix: API response
This commit is contained in:
@@ -97,12 +97,12 @@ export default class CollectionsStore extends BaseStore<Collection> {
|
||||
if (path) return path.title;
|
||||
}
|
||||
|
||||
delete(collection: Collection) {
|
||||
super.delete(collection);
|
||||
delete = async (collection: Collection) => {
|
||||
await super.delete(collection);
|
||||
|
||||
this.rootStore.documents.fetchRecentlyUpdated();
|
||||
this.rootStore.documents.fetchRecentlyViewed();
|
||||
}
|
||||
};
|
||||
|
||||
export = () => {
|
||||
return client.post("/collections.export_all");
|
||||
|
||||
@@ -503,7 +503,11 @@ export default class DocumentsStore extends BaseStore<Document> {
|
||||
formData.append("type", "outline");
|
||||
formData.append("file", file);
|
||||
|
||||
await client.post("/documents.batchImport", formData);
|
||||
const res = await client.post("/documents.batchImport", formData);
|
||||
invariant(res && res.data, "Data should be available");
|
||||
|
||||
this.addPolicies(res.policies);
|
||||
res.data.collections.forEach(this.rootStore.collections.add);
|
||||
};
|
||||
|
||||
@action
|
||||
|
||||
Reference in New Issue
Block a user