js_examples: Migrate and test get_stream_id example.

This commit is contained in:
Kartik Srivastava
2020-06-22 01:55:48 +05:30
committed by Tim Abbott
parent 63127d4990
commit 2c5815edbb
2 changed files with 9 additions and 12 deletions

View File

@@ -41,6 +41,7 @@ const ExamplesHandler = function () {
await generate_validation_data(client, examples.delete_queue);
await generate_validation_data(client, examples.get_messages);
await generate_validation_data(client, examples.get_own_user);
await generate_validation_data(client, examples.get_stream_id);
console.log(JSON.stringify(response_data));
return;
@@ -150,4 +151,11 @@ add_example('get_own_user', '/users/me:get', 200, async (client) => {
// {code_example|end}
});
add_example('get_stream_id', '/get_stream_id:get', 200, async (client) => {
// {code_example|start}
// Get the ID of a given stream
return await client.streams.getStreamId('Denmark');
// {code_example|end}
});
main();