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:
parent
0cf41171b8
commit
c4dd980421
1 changed files with 4 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue