mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Merge pull request #3633 from halfdan/3630-revoke-user
Fix revoke user invite and user.destroy
This commit is contained in:
commit
4b83dfd6ab
3 changed files with 8 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue