mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 12:21:58 +00:00
[manual] API add_subscriptions: Change arguments to support options.
Since in the future we might want requests to add subscriptions to include things like colors, in_home_view, etc., we're changing the data format for the add_subscriptions API call to pass each stream as a dictionary, giving a convenient place to put any added options. The manual step required here is updating the API version in AFS available for use with the zephyr_mirror.py system. (imported from commit 364960cca582a0658f0d334668822045c001b92c)
This commit is contained in:
@@ -640,7 +640,7 @@ function ajaxSubscribe(stream) {
|
||||
type: "POST",
|
||||
url: "/json/subscriptions/add",
|
||||
dataType: 'json', // This seems to be ignored. We still get back an xhr.
|
||||
data: {"subscriptions": JSON.stringify([stream]) },
|
||||
data: {"subscriptions": JSON.stringify([{"name": stream}]) },
|
||||
success: function (resp, statusText, xhr, form) {
|
||||
$("#create_stream_name").val("");
|
||||
|
||||
@@ -684,7 +684,7 @@ function ajaxSubscribeForCreation(stream, principals, invite_only) {
|
||||
type: "POST",
|
||||
url: "/json/subscriptions/add",
|
||||
dataType: 'json', // This seems to be ignored. We still get back an xhr.
|
||||
data: {"subscriptions": JSON.stringify([stream]),
|
||||
data: {"subscriptions": JSON.stringify([{"name": stream}]),
|
||||
"principals": JSON.stringify(principals),
|
||||
"invite_only": JSON.stringify(invite_only)
|
||||
},
|
||||
@@ -853,7 +853,7 @@ $(function () {
|
||||
type: "POST",
|
||||
url: "/json/subscriptions/add",
|
||||
dataType: 'json',
|
||||
data: {"subscriptions": JSON.stringify([stream]),
|
||||
data: {"subscriptions": JSON.stringify([{"name": stream}]),
|
||||
"principals": JSON.stringify([principal])},
|
||||
success: function (data) {
|
||||
text_box.val('');
|
||||
|
||||
Reference in New Issue
Block a user