diff --git a/ghost/collections/src/CollectionsService.ts b/ghost/collections/src/CollectionsService.ts index f1267d0d91..7253573acb 100644 --- a/ghost/collections/src/CollectionsService.ts +++ b/ghost/collections/src/CollectionsService.ts @@ -105,7 +105,6 @@ type QueryOptions = { interface PostsRepository { getAll(options: QueryOptions): Promise; - getBulk(ids: string[], transaction?: Knex.Transaction): Promise; } export class CollectionsService { @@ -392,8 +391,10 @@ export class CollectionsService { } async updatePostsInCollections(postIds: string[], collections: Collection[], transaction: Knex.Transaction) { - const posts = await this.postsRepository.getBulk(postIds, transaction); - + const posts = await this.postsRepository.getAll({ + filter: `id:[${postIds.join(',')}]`, + transaction: transaction + }); for (const collection of collections) { for (const post of posts) { diff --git a/ghost/collections/test/fixtures/PostsRepositoryInMemory.ts b/ghost/collections/test/fixtures/PostsRepositoryInMemory.ts index bd8b28f9eb..944ff415e4 100644 --- a/ghost/collections/test/fixtures/PostsRepositoryInMemory.ts +++ b/ghost/collections/test/fixtures/PostsRepositoryInMemory.ts @@ -10,10 +10,4 @@ export class PostsRepositoryInMemory extends InMemoryRepository tag.slug) }; } - - async getBulk(ids: string[]) { - return this.getAll({ - filter: `id:[${ids.join(',')}]` - }); - } }