fix: API response
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
// @flow
|
||||
import * as React from "react";
|
||||
import { Switch, Route } from "react-router-dom";
|
||||
import ImportExport from "scenes/Settings/ImportExport";
|
||||
import Settings from "scenes/Settings";
|
||||
import Details from "scenes/Settings/Details";
|
||||
import Groups from "scenes/Settings/Groups";
|
||||
import ImportExport from "scenes/Settings/ImportExport";
|
||||
import Notifications from "scenes/Settings/Notifications";
|
||||
import People from "scenes/Settings/People";
|
||||
import Security from "scenes/Settings/Security";
|
||||
|
||||
@@ -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