mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-17 21:41:49 +03:00
Updated bulkDestroy method to handle model updates
refs https://github.com/TryGhost/Ghost/commit/1dd52075 - Fixes bulkDestroy being passed the context - Fixes passing options.search to the model layer - Updates return value since the changes in referenced commit
This commit is contained in:
parent
7ee0df2ce6
commit
6540fd0cd0
@ -305,12 +305,16 @@ module.exports = class MemberRepository {
|
||||
filterOptions.transacting = options.transacting;
|
||||
}
|
||||
|
||||
if (options.context) {
|
||||
filterOptions.context = options.context;
|
||||
}
|
||||
|
||||
if (all !== true) {
|
||||
if (filter) {
|
||||
filterOptions.filter = filter;
|
||||
}
|
||||
|
||||
if (filter) {
|
||||
if (search) {
|
||||
filterOptions.search = search;
|
||||
}
|
||||
}
|
||||
@ -321,7 +325,13 @@ module.exports = class MemberRepository {
|
||||
|
||||
const memberIds = memberRows.map(row => row.id);
|
||||
|
||||
return this._Member.bulkDestroy(memberIds);
|
||||
const bulkDestroyResult = await this._Member.bulkDestroy(memberIds);
|
||||
|
||||
bulkDestroyResult.unsuccessfulIds = bulkDestroyResult.unsuccessfulData;
|
||||
|
||||
delete bulkDestroyResult.unsuccessfulData;
|
||||
|
||||
return bulkDestroyResult;
|
||||
}
|
||||
|
||||
async upsertCustomer(data) {
|
||||
|
Loading…
Reference in New Issue
Block a user