mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
Updated members bulk delete to work with filters/paid/search
no issue - use the same API query param generation for bulk delete requests as we use for the primary members list so that delete affects the same list that is visible/selected
This commit is contained in:
parent
23537355b6
commit
2326e3d616
@ -298,7 +298,14 @@ export default class MembersController extends Controller {
|
||||
|
||||
@task({drop: true})
|
||||
*deleteMembersTask() {
|
||||
let query = new URLSearchParams({all: true});
|
||||
let {label, paidParam, searchParam} = this;
|
||||
|
||||
let filter = label ? `label:${label}` : '';
|
||||
let paidQuery = paidParam ? {paid: paidParam} : {};
|
||||
let searchQuery = searchParam ? {search: searchParam} : {};
|
||||
let allQuery = !label && !paidParam && !searchParam ? {all: true} : {};
|
||||
|
||||
let query = new URLSearchParams(Object.assign({}, {filter}, paidQuery, searchQuery, allQuery));
|
||||
let url = `${this.ghostPaths.url.api('members')}?${query}`;
|
||||
|
||||
// response contains details of which members failed to be deleted
|
||||
|
Loading…
Reference in New Issue
Block a user