From 6de0a2bfffdf594161196ad7594dd79cec9fd28d Mon Sep 17 00:00:00 2001 From: "Fabien \"egg\" O'Carroll" Date: Thu, 14 Sep 2023 12:23:42 +0700 Subject: [PATCH] Fixed `#bulkDestroy` from calling `bulkDestroy` Rather than calling itself with the newly created transaction, it would call the "parent" method, which meant that two events were dispatched. TBH I think we can get rid of the check for a transaction here, and so the parent method too, but not 100% sure. --- ghost/posts-service/lib/PostsService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/posts-service/lib/PostsService.js b/ghost/posts-service/lib/PostsService.js index 3c758133cd..67f22d328b 100644 --- a/ghost/posts-service/lib/PostsService.js +++ b/ghost/posts-service/lib/PostsService.js @@ -366,7 +366,7 @@ class PostsService { async #bulkDestroy(options) { if (!options.transacting) { return await this.models.Post.transaction(async (transacting) => { - return await this.bulkDestroy({ + return await this.#bulkDestroy({ ...options, transacting });