-----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQTqYa7kNs8D7Oo9dgLSEYbwtHKVrQUCYNRcHQAKCRDSEYbwtHKV
 rQJeAP9ufmgIztn1oj8kF7tZMZk4xaVCakqIgyQBlPvFKc+aawD8Dv44mmZ4Ntar
 7FQ52i07TCwk/b8lCUwxD4maYBuZNAE=
 =fgVN
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQTqYa7kNs8D7Oo9dgLSEYbwtHKVrQUCYNRciwAKCRDSEYbwtHKV
 rRatAQCJ27vyVeGYlnXVWF0XSgj3+QEwl2eEgh4GoVp4BPzHAwD/WrGvKRvddDtA
 kiqv93vRTda3GV1R4FGYVl34MwbGFAA=
 =+Yci
 -----END PGP SIGNATURE-----

Merged v4.8.1 into main

v4.8.1
This commit is contained in:
Daniel Lockyer 2021-06-24 11:20:53 +01:00
commit ac8029680c
5 changed files with 12 additions and 5 deletions

@ -1 +1 @@
Subproject commit a2517f3190e9ee77ef0e7fef5372fae43356c002
Subproject commit 4c4fcdad486670e9202f8ca22f77c4333c3bb3ec

View File

@ -97,6 +97,8 @@ module.exports = {
},
permissions: true,
query(frame) {
frame.options.require = true;
return models.Snippet.destroy(frame.options)
.then(() => null)
.catch(models.Snippet.NotFoundError, () => {

View File

@ -97,6 +97,8 @@ module.exports = {
},
permissions: true,
query(frame) {
frame.options.require = true;
return models.Snippet.destroy(frame.options)
.then(() => null)
.catch(models.Snippet.NotFoundError, () => {

View File

@ -198,7 +198,7 @@ module.exports = function (Bookshelf) {
* @param {Object} [unfilteredOptions]
* @return {Promise<Bookshelf['Model']>} Empty Model
*/
destroy: async function destroy(unfilteredOptions) {
destroy: function destroy(unfilteredOptions) {
const options = this.filterOptions(unfilteredOptions, 'destroy');
if (!options.destroyBy) {
@ -208,8 +208,11 @@ module.exports = function (Bookshelf) {
}
// Fetch the object before destroying it, so that the changed data is available to events
const obj = await this.forge(options.destroyBy).fetch(options);
return obj.destroy(options);
return this.forge(options.destroyBy)
.fetch(options)
.then(function then(obj) {
return obj.destroy(options);
});
},
// When loading an instance, subclasses can specify default to fetch

View File

@ -1,6 +1,6 @@
{
"name": "ghost",
"version": "4.8.0",
"version": "4.8.1",
"description": "The professional publishing platform",
"author": "Ghost Foundation",
"homepage": "https://ghost.org",