SHARE
TWEET
Untitled
a guest
Mar 31st, 2019
117
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- return new Promise((resolve, reject) => {
- client.query('SELECT * FROM users WHERE user_id = $1', [event.key1])
- .then(data => {
- userData.push(data.rows);
- client.query('SELECT * FROM comments WHERE parent_id = $2 ORDER BY points DESC FETCH FIRST 5 ROW ONLY', [event.key2], (error, result) => {
- if(error){
- throw error;
- }else{
- userData.push(result.rows);
- resolve(userData);
- }
- });
- })
- .catch(err => {
- console.log(err);
- });
- });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

