Last active
May 29, 2018 18:17
-
-
Save MichaelNahum/7621d7cd24c5a3961e9d51768f6b24e8 to your computer and use it in GitHub Desktop.
Promise Issue
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
function getMessage(userId, messageId, callback) { | |
let request = gapi.client.gmail.users.messages.get({ | |
'userId': me, | |
'id': messageId | |
}) | |
console.log(request) | |
request.execute(callback) | |
} | |
function listMessages(auth) { | |
const gmail = google.gmail({version: 'v1', auth}); | |
gmail.users.messages.list({ | |
userId: 'me', | |
}, (err, data) => { | |
let example = data.data.messages; | |
//console.log(example) | |
example.forEach(function(email) { | |
// console.log(email) | |
let emailId = email.id | |
}).then(getMessage(me, emailId, callback)) |
Pugio
commented
May 29, 2018
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment