fix: Don't trigger email and slack notifications when mass importing
feat: Show success message after import
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user