mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 23:43:43 +00:00
[manual] Use "subscriptions" for {add,list}_subscriptions consistently.
This change requires a zephyr_mirror deployment when it is pushed to prod. (imported from commit a31d6efd2db4d4617c7c6b00326be3f07c7263da)
This commit is contained in:
@@ -107,7 +107,7 @@ class HumbugAPI():
|
|||||||
return self.do_api_query(request, "/api/v1/subscriptions/list")
|
return self.do_api_query(request, "/api/v1/subscriptions/list")
|
||||||
|
|
||||||
def add_subscriptions(self, streams):
|
def add_subscriptions(self, streams):
|
||||||
request = {'streams': streams}
|
request = {'subscriptions': streams}
|
||||||
return self.do_api_query(request, "/api/v1/subscriptions/add")
|
return self.do_api_query(request, "/api/v1/subscriptions/add")
|
||||||
|
|
||||||
def call_on_each_message(self, callback, options = {}):
|
def call_on_each_message(self, callback, options = {}):
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ exports.subscribe_for_send = function (stream, prompt_button) {
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: '/json/subscriptions/add',
|
url: '/json/subscriptions/add',
|
||||||
data: {"streams": JSON.stringify([stream]) },
|
data: {"subscriptions": JSON.stringify([stream]) },
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
timeout: 10*60*1000, // 10 minutes in ms
|
timeout: 10*60*1000, // 10 minutes in ms
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
@@ -90,7 +90,7 @@ function ajaxSubscribe(stream) {
|
|||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/json/subscriptions/add",
|
url: "/json/subscriptions/add",
|
||||||
dataType: 'json', // This seems to be ignored. We still get back an xhr.
|
dataType: 'json', // This seems to be ignored. We still get back an xhr.
|
||||||
data: {"streams": JSON.stringify([stream]) },
|
data: {"subscriptions": JSON.stringify([stream]) },
|
||||||
success: function (resp, statusText, xhr, form) {
|
success: function (resp, statusText, xhr, form) {
|
||||||
if ($("#streams").val() === stream) {
|
if ($("#streams").val() === stream) {
|
||||||
$("#streams").val("");
|
$("#streams").val("");
|
||||||
|
|||||||
@@ -702,7 +702,7 @@ def gather_subscriptions(user_profile):
|
|||||||
|
|
||||||
@authenticated_api_view
|
@authenticated_api_view
|
||||||
def api_list_subscriptions(request, user_profile):
|
def api_list_subscriptions(request, user_profile):
|
||||||
return json_success({"streams": gather_subscriptions(user_profile)})
|
return json_success({"subscriptions": gather_subscriptions(user_profile)})
|
||||||
|
|
||||||
@authenticated_json_view
|
@authenticated_json_view
|
||||||
def json_list_subscriptions(request, user_profile):
|
def json_list_subscriptions(request, user_profile):
|
||||||
@@ -733,7 +733,8 @@ def json_add_subscriptions(request, user_profile):
|
|||||||
return add_subscriptions_backend(request, user_profile)
|
return add_subscriptions_backend(request, user_profile)
|
||||||
|
|
||||||
@has_request_variables
|
@has_request_variables
|
||||||
def add_subscriptions_backend(request, user_profile, streams_raw = POST('streams', simplejson.loads)):
|
def add_subscriptions_backend(request, user_profile,
|
||||||
|
streams_raw = POST('subscriptions', simplejson.loads)):
|
||||||
streams = []
|
streams = []
|
||||||
for stream_name in streams_raw:
|
for stream_name in streams_raw:
|
||||||
stream_name = stream_name.strip()
|
stream_name = stream_name.strip()
|
||||||
|
|||||||
Reference in New Issue
Block a user