fix: API response

This commit is contained in:
Tom Moor
2020-12-26 23:12:22 -08:00
parent 7021c2a9e5
commit c8cd7fcf4a
7 changed files with 38 additions and 18 deletions

View File

@@ -1124,7 +1124,7 @@ router.post("documents.batchImport", auth(), async (ctx) => {
const user = ctx.state.user;
authorize(user, "batchImport", Document);
await documentBatchImporter({
const { collections } = await documentBatchImporter({
file,
user,
type,
@@ -1132,7 +1132,12 @@ router.post("documents.batchImport", auth(), async (ctx) => {
});
ctx.body = {
success: true,
data: {
collections: collections.map((collection) =>
presentCollection(collection)
),
},
policies: presentPolicies(user, collections),
};
});