fix: Don't trigger email and slack notifications when mass importing

feat: Show success message after import
This commit is contained in:
Tom Moor
2020-12-28 18:02:58 -08:00
parent 2787e56de3
commit d79933887d
10 changed files with 47 additions and 7 deletions

View File

@@ -1124,7 +1124,7 @@ router.post("documents.batchImport", auth(), async (ctx) => {
const user = ctx.state.user;
authorize(user, "batchImport", Document);
const { collections } = await documentBatchImporter({
const { documents, attachments, collections } = await documentBatchImporter({
file,
user,
type,
@@ -1133,6 +1133,9 @@ router.post("documents.batchImport", auth(), async (ctx) => {
ctx.body = {
data: {
attachmentCount: attachments.length,
documentCount: documents.length,
collectionCount: collections.length,
collections: collections.map((collection) =>
presentCollection(collection)
),
@@ -1189,6 +1192,7 @@ router.post("documents.import", auth(), async (ctx) => {
});
const document = await documentCreator({
source: "import",
title,
text,
publish,