Skip to content

Commit 3634bba

Browse files
author
Joe Alves
committed
Merge remote-tracking branch 'origin/master'
2 parents 200e191 + 80621c9 commit 3634bba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

generated/server/db/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ mongoose.Promise = Promise;
1616
// anywhere the User model needs to be used.
1717
require('./models');
1818

19+
// Modifying startDbPromise to return the db object to have an access to it when .then on startDbPromise
1920
var startDbPromise = new Promise(function (resolve, reject) {
20-
db.on('open', resolve);
21+
db.on('open', function() {
22+
resolve(db)
23+
});
2124
db.on('error', reject);
2225
});
2326

0 commit comments

Comments
 (0)