0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Updated User model to support actions

closes #11013
This commit is contained in:
Fabien O'Carroll 2019-08-14 11:20:32 +08:00
parent 657d0fc067
commit ab70a369fa

View file

@ -322,6 +322,24 @@ User = ghostBookshelf.Model.extend({
delete options.status;
return filter;
},
getAction(event, options) {
const actor = this.getActor(options);
// @NOTE: we ignore internal updates (`options.context.internal`) for now
if (!actor) {
return;
}
// @TODO: implement context
return {
event: event,
resource_id: this.id || this.previous('id'),
resource_type: 'user',
actor_id: actor.id,
actor_type: actor.type
};
}
}, {
orderDefaultOptions: function orderDefaultOptions() {