From 687cf5a95cd09d3eb485c2e7222c31625c0df40c Mon Sep 17 00:00:00 2001 From: kai <58456495+chairulakmal@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:55:14 +0700 Subject: [PATCH] Removed Bluebird dependency (#17831) refs https://github.com/TryGhost/Ghost/issues/14882 - this removes the last usage of Bluebird within Ghost and removes the dependency as it's no longer required within the codebase --- ghost/core/core/server/models/base/plugins/raw-knex.js | 7 ++++--- ghost/core/package.json | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ghost/core/core/server/models/base/plugins/raw-knex.js b/ghost/core/core/server/models/base/plugins/raw-knex.js index ffdf38fadd6..30e76e4d996 100644 --- a/ghost/core/core/server/models/base/plugins/raw-knex.js +++ b/ghost/core/core/server/models/base/plugins/raw-knex.js @@ -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'); @@ -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]) { diff --git a/ghost/core/package.json b/ghost/core/package.json index 0004c1f853e..0a20d5b4295 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -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",