mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Renamed destroyByAuthor to reassignByAuthor
refs https://github.com/TryGhost/Toolbox/issues/268 - The previous naming didn't make much sense in the context of what the method what doing
This commit is contained in:
parent
5ba3f5efcf
commit
75170535a4
2 changed files with 5 additions and 5 deletions
|
@ -294,14 +294,14 @@ module.exports.extendModel = function extendModel(Post, Posts, ghostBookshelf) {
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
/**
|
/**
|
||||||
* ### destroyByAuthor
|
* ### reassignByAuthor
|
||||||
* @param {Object} unfilteredOptions has context and id. Context is the user doing the destroy, id is the user to destroy
|
* @param {Object} unfilteredOptions has context and id. Context is the user doing the destroy, id is the user to destroy
|
||||||
* @param {string} unfilteredOptions.id
|
* @param {string} unfilteredOptions.id
|
||||||
* @param {Object} unfilteredOptions.context
|
* @param {Object} unfilteredOptions.context
|
||||||
* @param {Object} unfilteredOptions.transacting
|
* @param {Object} unfilteredOptions.transacting
|
||||||
*/
|
*/
|
||||||
destroyByAuthor: async function destroyByAuthor(unfilteredOptions) {
|
reassignByAuthor: async function reassignByAuthor(unfilteredOptions) {
|
||||||
let options = this.filterOptions(unfilteredOptions, 'destroyByAuthor', {extraAllowedProperties: ['id']});
|
let options = this.filterOptions(unfilteredOptions, 'reassignByAuthor', {extraAllowedProperties: ['id']});
|
||||||
let authorId = options.id;
|
let authorId = options.id;
|
||||||
|
|
||||||
if (!authorId) {
|
if (!authorId) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ const path = require('path');
|
||||||
* @prop {Object} Base
|
* @prop {Object} Base
|
||||||
* @prop {(callback: function) => Promise} Base.transaction
|
* @prop {(callback: function) => Promise} Base.transaction
|
||||||
* @prop {Object} Post
|
* @prop {Object} Post
|
||||||
* @prop {(frameOptions: Object) => Promise} Post.destroyByAuthor
|
* @prop {(frameOptions: Object) => Promise} Post.reassignByAuthor
|
||||||
* @prop {Object} ApiKey
|
* @prop {Object} ApiKey
|
||||||
* @prop {(Object) => Promise} ApiKey.destroy
|
* @prop {(Object) => Promise} ApiKey.destroy
|
||||||
* @prop {Object} ApiKey.NotFoundError
|
* @prop {Object} ApiKey.NotFoundError
|
||||||
|
@ -76,7 +76,7 @@ class Users {
|
||||||
return this.models.Base.transaction(async (t) => {
|
return this.models.Base.transaction(async (t) => {
|
||||||
frameOptions.transacting = t;
|
frameOptions.transacting = t;
|
||||||
|
|
||||||
await this.models.Post.destroyByAuthor(frameOptions);
|
await this.models.Post.reassignByAuthor(frameOptions);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.models.ApiKey.destroy({
|
await this.models.ApiKey.destroy({
|
||||||
|
|
Loading…
Reference in a new issue