diff --git a/web/src/subscriber_api.ts b/web/src/subscriber_api.ts index eb7ebce354..a2936f1201 100644 --- a/web/src/subscriber_api.ts +++ b/web/src/subscriber_api.ts @@ -14,20 +14,21 @@ export function add_user_ids_to_stream( sub: StreamSubscription, success: () => void, failure: (xhr: JQuery.jqXHR) => void, -): JQuery.jqXHR | undefined { +): void { // TODO: use stream_id when backend supports it const stream_name = sub.name; if (user_ids.length === 1 && people.is_my_user_id(Number(user_ids[0]))) { // Self subscribe const color = sub.color; - return channel.post({ + void channel.post({ url: "/json/users/me/subscriptions", data: {subscriptions: JSON.stringify([{name: stream_name, color}])}, success, error: failure, }); + return; } - return channel.post({ + void channel.post({ url: "/json/users/me/subscriptions", data: { subscriptions: JSON.stringify([{name: stream_name}]), @@ -43,10 +44,10 @@ export function remove_user_id_from_stream( sub: StreamSubscription, success: () => void, failure: (xhr: JQuery.jqXHR) => void, -): JQuery.jqXHR | undefined { +): void { // TODO: use stream_id when backend supports it const stream_name = sub.name; - return channel.del({ + void channel.del({ url: "/json/users/me/subscriptions", data: {subscriptions: JSON.stringify([stream_name]), principals: JSON.stringify([user_id])}, success,