diff --git a/core/client/adapters/user.js b/core/client/adapters/user.js index 6d75617f67..66ace226b8 100644 --- a/core/client/adapters/user.js +++ b/core/client/adapters/user.js @@ -32,6 +32,12 @@ var UserAdapter = EmbeddedRelationAdapter.extend({ // Use the url from the ApplicationAdapter's buildURL method return this.ajax(url, 'PUT', { data: data }); + }, + + find: function (store, type, id) { + var url = this.buildQuery(store, type, id); + url.status = 'all'; + return this.findQuery(store, type, url); } }); diff --git a/core/server/api/users.js b/core/server/api/users.js index 6224c5e967..a4b6e68312 100644 --- a/core/server/api/users.js +++ b/core/server/api/users.js @@ -282,7 +282,7 @@ users = { */ destroy: function destroy(options) { return canThis(options.context).destroy.user(options.id).then(function () { - return users.read(options).then(function (result) { + return users.read(_.merge(options, { status: 'all'})).then(function (result) { return dataProvider.Base.transaction(function (t) { options.transacting = t; dataProvider.Post.destroyByAuthor(options).then(function () { diff --git a/core/server/models/user.js b/core/server/models/user.js index b8c0c4baa8..b7253c6442 100644 --- a/core/server/models/user.js +++ b/core/server/models/user.js @@ -513,7 +513,7 @@ User = ghostBookshelf.Model.extend({ // Grab the original args without the first one origArgs = _.toArray(arguments).slice(1); // Get the actual post model - return this.findOne({id: userModelOrId}).then(function (foundUserModel) { + return this.findOne({id: userModelOrId, status: 'all'}).then(function (foundUserModel) { // Build up the original args but substitute with actual model var newArgs = [foundUserModel].concat(origArgs);