Closed gRoberts84 closed 2 months ago
Apologies, I didn't read the documentation properly 🤦♂️
let response = await client.api('/teams').responseType(graph.ResponseType.RAW).post({
'@microsoft.graph.teamCreationMode': 'migration',
'template@odata.bind': "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
'displayName': 'Clients',
'description': 'Description for clients team',
'createdDateTime': '2020-03-14T11:22:17.067Z'
});
const team_id = response.headers.get('content-location').replace('/teams(\'', '').replace('\')', '');
I don't know why but I misread the documentation and thought it would return the team object as if you had done a get on one.
Bug Report
Prerequisites
For more information, see the
CONTRIBUTING
guide.Description
When attempting to create an item (e.g. Team), it returns a ReadableStream with no response.
Steps to Reproduce
Expected behavior:
Based on the documentation, I should receive a response object containing information relating to the object I've just created.
Actual behavior:
When console logging
team
, I receive:ReadableStream { locked: false, state: 'readable', supportsBYOB: true }
If I try to use
consumables
to convert the stream to text/json, it returns an empty string or error that it's invalid json.Additional Context
I am currently trying to create a team/channel etc in migration mode to import messages from another platform.
If I send an invalid request, it correctly returns the error.
Package versions:
Usage Information
Request ID - Value of the
requestId
field if you are receiving a Graph API error responseSDK Version - [SDK version you are using]