mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05: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
1 changed files with 12 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue