-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added bug fix where attempted to pass multiple things out of promise
- Loading branch information
1 parent
f274582
commit f0aeefb
Showing
4 changed files
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
module.exports = function(userID, phone) { | ||
return new Promise((resolve, reject) => { | ||
this.pgConnect() | ||
.then(pgDatabase => { | ||
.then(({ database, done }) => { | ||
// pgClient.query... blah blah logic | ||
//invoke done before your resolve this promise | ||
console.log("called create"); | ||
done(); | ||
}) | ||
.catch(err => reject(err)); | ||
.catch((err, done) => { | ||
//invoke done before you reject | ||
reject(err); | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
module.exports = function(userID, phone) { | ||
return new Promise((resolve, reject) => { | ||
this.pgConnect() | ||
.then(pgDatabase => { | ||
.then(({ database, done }) => { | ||
// pgClient.query... blah blah logic | ||
//invoke done before your resolve this promise | ||
console.log("called create"); | ||
done(); | ||
}) | ||
.catch(err => reject(err)); | ||
.catch((err, done) => { | ||
//invoke done before you reject | ||
reject(err); | ||
}); | ||
}); | ||
}; |