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

@@ -27,6 +27,9 @@ export default class Notifications {
}
async documentUpdated(event: DocumentEvent) {
// never send notifications when batch importing documents
if (event.data && event.data.source === "import") return;
const document = await Document.findByPk(event.documentId);
if (!document) return;

View File

@@ -55,6 +55,9 @@ export default class Slack {
}
async documentUpdated(event: DocumentEvent) {
// never send notifications when batch importing documents
if (event.data && event.data.source === "import") return;
const document = await Document.findByPk(event.documentId);
if (!document) return;