From a5f158c061ed59bfd34cebd13b78a5840463f36f Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Fri, 1 Oct 2021 12:07:07 +0200 Subject: [PATCH] Updated usage of the members bulk action endpoint refs https://github.com/TryGhost/Team/issues/1077 The bulk action endpoint has updated the request body format and so this must be updated to continue to work with it. --- ghost/admin/app/controllers/members.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/ghost/admin/app/controllers/members.js b/ghost/admin/app/controllers/members.js index 8f2bbc21cd..2c84caa067 100644 --- a/ghost/admin/app/controllers/members.js +++ b/ghost/admin/app/controllers/members.js @@ -478,8 +478,10 @@ export default class MembersController extends Controller { // response contains details of which members failed to be unsubscribe const response = yield this.ajax.put(unsubscribeUrl, { data: { - action: 'unsubscribe', - meta: {} + bulk: { + action: 'unsubscribe', + meta: {} + } } }); @@ -499,10 +501,12 @@ export default class MembersController extends Controller { const addLabelUrl = `${this.ghostPaths.url.api('members/bulk')}?${query}`; const response = yield this.ajax.put(addLabelUrl, { data: { - action: 'addLabel', - meta: { - label: { - id: selectedLabel + bulk: { + action: 'addLabel', + meta: { + label: { + id: selectedLabel + } } } } @@ -521,10 +525,12 @@ export default class MembersController extends Controller { const removeLabelUrl = `${this.ghostPaths.url.api('members/bulk')}?${query}`; const response = yield this.ajax.put(removeLabelUrl, { data: { - action: 'removeLabel', - meta: { - label: { - id: selectedLabel + bulk: { + action: 'removeLabel', + meta: { + label: { + id: selectedLabel + } } } }