mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
js_examples: Migrate and test register_queue example.
This commit is contained in:
committed by
Tim Abbott
parent
4aec4cbfae
commit
5a4d31825c
@@ -45,6 +45,7 @@ const ExamplesHandler = function () {
|
||||
await generate_validation_data(client, examples.get_stream_topics);
|
||||
await generate_validation_data(client, examples.get_subscriptions);
|
||||
await generate_validation_data(client, examples.get_users);
|
||||
await generate_validation_data(client, examples.register_queue);
|
||||
|
||||
console.log(JSON.stringify(response_data));
|
||||
return;
|
||||
@@ -188,4 +189,15 @@ add_example('get_users', '/users:get', 200, async (client) => {
|
||||
return [result_1, result_2];
|
||||
});
|
||||
|
||||
add_example('register_queue', '/register:post', 200, async (client) => {
|
||||
// {code_example|start}
|
||||
// Register a queue
|
||||
const params = {
|
||||
event_types: ['message'],
|
||||
};
|
||||
|
||||
return await client.queues.register(params);
|
||||
// {code_example|end}
|
||||
});
|
||||
|
||||
main();
|
||||
|
||||
Reference in New Issue
Block a user