mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Fixed issue with filter transform not applying to bulk operations
This commit is contained in:
parent
152a2ea41f
commit
f0798578c4
1 changed files with 6 additions and 32 deletions
|
@ -566,24 +566,11 @@ module.exports = class MemberRepository {
|
|||
});
|
||||
}
|
||||
|
||||
const filterOptions = {};
|
||||
|
||||
if (options.transacting) {
|
||||
filterOptions.transacting = options.transacting;
|
||||
}
|
||||
|
||||
if (options.context) {
|
||||
filterOptions.context = options.context;
|
||||
}
|
||||
const filterOptions = _.pick(options, ['transacting', 'context']);
|
||||
|
||||
if (all !== true) {
|
||||
if (filter) {
|
||||
filterOptions.filter = filter;
|
||||
}
|
||||
|
||||
if (search) {
|
||||
filterOptions.search = search;
|
||||
}
|
||||
// Include mongoTransformer to apply subscribed:{true|false} => newsletter relation mapping
|
||||
Object.assign(filterOptions, _.pick(options, ['filter', 'search', 'mongoTransformer']));
|
||||
}
|
||||
|
||||
const memberRows = await this._Member.getFilteredCollectionQuery(filterOptions)
|
||||
|
@ -616,24 +603,11 @@ module.exports = class MemberRepository {
|
|||
});
|
||||
}
|
||||
|
||||
const filterOptions = {};
|
||||
|
||||
if (options.transacting) {
|
||||
filterOptions.transacting = options.transacting;
|
||||
}
|
||||
|
||||
if (options.context) {
|
||||
filterOptions.context = options.context;
|
||||
}
|
||||
const filterOptions = _.pick(options, ['transacting', 'context']);
|
||||
|
||||
if (all !== true) {
|
||||
if (filter) {
|
||||
filterOptions.filter = filter;
|
||||
}
|
||||
|
||||
if (search) {
|
||||
filterOptions.search = search;
|
||||
}
|
||||
// Include mongoTransformer to apply subscribed:{true|false} => newsletter relation mapping
|
||||
Object.assign(filterOptions, _.pick(options, ['filter', 'search', 'mongoTransformer']));
|
||||
}
|
||||
|
||||
const memberRows = await this._Member.getFilteredCollectionQuery(filterOptions)
|
||||
|
|
Loading…
Add table
Reference in a new issue