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.
This commit is contained in:
Fabien O'Carroll 2021-10-01 12:07:07 +02:00
parent 9dcd7e499a
commit a5f158c061

View File

@ -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
}
}
}
}