mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added primary_name
context for added events
refs https://github.com/TryGhost/Toolbox/issues/356 - we should store the `primary_name` on `added` events too because if the resource is eventually deleted, we won't have the pretty name to refer to it
This commit is contained in:
parent
c860b5b715
commit
76406f78bb
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ module.exports = function (Bookshelf) {
|
|||
|
||||
if (event === 'deleted') {
|
||||
context.primary_name = (this.previous('title') || this.previous('name'));
|
||||
} else if (event === 'edited') {
|
||||
} else if (['added', 'edited'].includes(event)) {
|
||||
context.primary_name = (this.get('title') || this.get('name') || this.previous('title') || this.previous('name'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue