mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Fixed bulk unsubscribe
refs https://github.com/TryGhost/Team/issues/1567 - Deletes the newsletter relations instead of setting subscribed to false - Depends on these changes: https://github.com/TryGhost/Ghost/pull/14610
This commit is contained in:
parent
a49bb037c4
commit
f051f9aeeb
@ -587,11 +587,13 @@ module.exports = class MemberRepository {
|
||||
const memberIds = memberRows.map(row => row.id);
|
||||
|
||||
if (data.action === 'unsubscribe') {
|
||||
return await this._Member.bulkEdit(memberIds, 'members', {
|
||||
data: {
|
||||
subscribed: false
|
||||
}
|
||||
const memberNewsletterRows = await this._Member.getNewsletterRelations({
|
||||
memberIds
|
||||
});
|
||||
|
||||
const membersNewsletterIds = memberNewsletterRows.map(row => row.id);
|
||||
|
||||
return await this._Member.bulkDestroy(membersNewsletterIds, 'members_newsletters');
|
||||
}
|
||||
|
||||
if (data.action === 'removeLabel') {
|
||||
|
Loading…
Reference in New Issue
Block a user