0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Fixed transaction usage in bulk tag adding

refs https://github.com/TryGhost/Team/issues/2922
This commit is contained in:
Simon Backx 2023-04-13 17:47:00 +02:00
parent 0cf41171b8
commit c4dd980421

View file

@ -146,7 +146,8 @@ class PostsService {
const postRows = await this.models.Post.getFilteredCollectionQuery({
filter: options.filter,
status: 'all'
status: 'all',
transacting: options.transacting
}).select('posts.id');
const postTags = data.tags.reduce((pt, tag) => {
@ -183,7 +184,8 @@ class PostsService {
const postRows = await this.models.Post.getFilteredCollectionQuery({
filter: options.filter,
status: 'all'
status: 'all',
transacting: options.transacting
}).select('posts.id');
await options.transacting('posts_tags').whereIn('post_id', postRows.map(post => post.id)).whereIn('tag_id', data.tags).del();