diff --git a/server/commands/accountProvisioner.ts b/server/commands/accountProvisioner.ts index e000c9ea4f..cf782935c6 100644 --- a/server/commands/accountProvisioner.ts +++ b/server/commands/accountProvisioner.ts @@ -245,6 +245,7 @@ async function provisionFirstCollection(team: Team, user: User) { document.content = await DocumentHelper.toJSON(document); await document.publish(user, collection.id, { + silent: true, transaction, }); } diff --git a/server/models/Document.ts b/server/models/Document.ts index a22652bf3e..0c82157752 100644 --- a/server/models/Document.ts +++ b/server/models/Document.ts @@ -361,7 +361,7 @@ class Document extends ParanoidModel< @BeforeSave static async updateCollectionStructure( model: Document, - { transaction }: SaveOptions + { transaction }: SaveOptions> ) { // templates, drafts, and archived documents don't appear in the structure // and so never need to be updated when the title changes @@ -811,8 +811,8 @@ class Document extends ParanoidModel< publish = async ( user: User, collectionId: string, - options: SaveOptions - ) => { + options: SaveOptions + ): Promise => { const { transaction } = options; // If the document is already published then calling publish should act like diff --git a/server/models/Event.ts b/server/models/Event.ts index e849b4ac3e..49460ff3f5 100644 --- a/server/models/Event.ts +++ b/server/models/Event.ts @@ -77,7 +77,10 @@ class Event extends IdModel< } @AfterSave - static async enqueue(model: Event, options: SaveOptions) { + static async enqueue( + model: Event, + options: SaveOptions> + ) { if (options.transaction) { options.transaction.afterCommit(() => void globalEventQueue.add(model)); return; diff --git a/server/models/Notification.ts b/server/models/Notification.ts index 2f76b6b156..31dd9d19fc 100644 --- a/server/models/Notification.ts +++ b/server/models/Notification.ts @@ -177,7 +177,7 @@ class Notification extends Model< @AfterCreate static async createEvent( model: Notification, - options: SaveOptions + options: SaveOptions> ) { const params = { name: "notifications.create",