Skip to content

Commit

Permalink
Removed Bluebird dependency (#17831)
Browse files Browse the repository at this point in the history
refs #14882

- this removes the last usage of Bluebird within Ghost and removes the dependency as it's no longer required within the codebase
  • Loading branch information
chairulakmal authored Aug 29, 2023
1 parent 1128655 commit 687cf5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions ghost/core/core/server/models/base/plugins/raw-knex.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const _ = require('lodash');
const debug = require('@tryghost/debug')('models:base:raw-knex');
const plugins = require('@tryghost/bookshelf-plugins');
const Promise = require('bluebird');

const schema = require('../../../data/schema');

Expand Down Expand Up @@ -166,10 +165,12 @@ module.exports = function (Bookshelf) {
})();
});

return Promise.props(props)
.then((relationsToAttach) => {
return Promise.all(Object.values(props))
.then((relationsToAttachArray) => {
debug('attach relations', modelName);

const relationsToAttach = _.zipObject(_.keys(props), relationsToAttachArray);

objects = _.map(objects, (object) => {
_.each(Object.keys(relationsToAttach), (relation) => {
if (!relationsToAttach[relation][object.id]) {
Expand Down
1 change: 0 additions & 1 deletion ghost/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@
"@tryghost/zip": "1.1.37",
"amperize": "0.6.1",
"analytics-node": "6.2.0",
"bluebird": "3.7.2",
"body-parser": "1.20.2",
"bookshelf": "1.2.0",
"bookshelf-relations": "2.6.0",
Expand Down

0 comments on commit 687cf5a

Please sign in to comment.