You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Methods .getStream and .putStream don't support Promises #110
When trying to use the "Promise" syntax of the .getStream method (ie. with no callback),
client.api(url).getStream()
.then(stream => {
// do something with stream
})
.catch(err => {
// do domething with err
})
I get the following error:
TypeError: Cannot read property 'then' of undefined
Nevertheless, the"callback" syntax works great:
return new Promise((resolve, reject) => {
client.api(url).getStream((err, stream) => {
if (err) {
// do domething with err
}
else {
// do something with stream
}
});
});
client.api(url).putStream(buffer)
.then(response => {
// do something with response
})
gives the following error:
TypeError: callback is not a function
at Function.ResponseHandler.init (/.../node_modules/@microsoft/microsoft-graph-client/src/ResponseHandler.ts:6:13)
at /.../node_modules/@microsoft/microsoft-graph-client/src/GraphRequest.ts:291:33
at process._tickCallback (internal/process/next_tick.js:68:7)
changed the title [-]Methods .getStream and .putStream doesn't support Promises[/-][+]Methods .getStream and .putStream don't support Promises[/+]on Sep 10, 2018
Activity
jmorino commentedon Sep 10, 2018
The same goes for the
.putStreammethod:gives the following error:
[-]Method .getStream doesn't support Promises[/-][+]Methods .getStream and .putStream doesn't support Promises[/+][-]Methods .getStream and .putStream doesn't support Promises[/-][+]Methods .getStream and .putStream don't support Promises[/+]muthurathinam commentedon Sep 10, 2018
This is done in this pull request and will be available in our next release.
876748
muthurathinam commentedon Sep 22, 2018
Released: https://github.com/microsoftgraph/msgraph-sdk-javascript/releases/tag/1.3.0