mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Disabled autoRefresh
for inserted Actions events
- we don't end up using the inserted model from Bookshelf, so we shouldn't be performing a SELECT on the entry - this disables refreshing the model using Bookshelf's `autoRefresh: false` and allows the key through the sanitization for `add
This commit is contained in:
parent
150f2f8a5f
commit
f45bba21f6
2 changed files with 3 additions and 1 deletions
|
@ -93,7 +93,7 @@ module.exports = function (Bookshelf) {
|
|||
|
||||
const insert = (action) => {
|
||||
Bookshelf.model('Action')
|
||||
.add(action)
|
||||
.add(action, {autoRefresh: false})
|
||||
.catch((err) => {
|
||||
if (_.isArray(err)) {
|
||||
err = err[0];
|
||||
|
|
|
@ -38,6 +38,8 @@ module.exports = function (Bookshelf) {
|
|||
return baseOptions.concat('shallow', 'columns', 'previous');
|
||||
case 'destroy':
|
||||
return baseOptions.concat(extraOptions, ['id', 'destroyBy', 'require']);
|
||||
case 'add':
|
||||
return baseOptions.concat(extraOptions, ['autoRefresh']);
|
||||
case 'edit':
|
||||
return baseOptions.concat(extraOptions, ['id', 'require']);
|
||||
case 'findOne':
|
||||
|
|
Loading…
Add table
Reference in a new issue