Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stream_edit_subscribers: Fix incorrect error result test.

Anders Kaseorg15d4866856ef
diff --git a/web/src/stream_edit_subscribers.ts b/web/src/stream_edit_subscribers.ts
index c1b6ea72342..c5acb9e260d 100644
--- a/web/src/stream_edit_subscribers.ts
+++ b/web/src/stream_edit_subscribers.ts
@@ -248,16 +248,13 @@ function subscribe_new_users({pill_user_ids}: {pill_user_ids: number[]}): void {
const failure_response_schema = z
.object({
+ result: z.literal("error"),
msg: z.string(),
code: z.string(),
- result: z.string(),
})
.safeParse(xhr.responseJSON);
- if (
- failure_response_schema.success &&
- failure_response_schema.data.code === "BAD_REQUEST"
- ) {
+ if (failure_response_schema.success) {
message = failure_response_schema.data.msg;
}
show_stream_subscription_request_result({