stream_edit_subscribers: Rename misleading variable.

.safeParse does not return a “schema”.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-06-21 13:42:22 -07:00 committed by Tim Abbott
parent 15d4866856
commit 39d4ddaa96
1 changed files with 3 additions and 3 deletions

View File

@ -246,7 +246,7 @@ function subscribe_new_users({pill_user_ids}: {pill_user_ids: number[]}): void {
function invite_failure(xhr: JQuery.jqXHR): void { function invite_failure(xhr: JQuery.jqXHR): void {
let message = "Failed to subscribe user!"; let message = "Failed to subscribe user!";
const failure_response_schema = z const parsed = z
.object({ .object({
result: z.literal("error"), result: z.literal("error"),
msg: z.string(), msg: z.string(),
@ -254,8 +254,8 @@ function subscribe_new_users({pill_user_ids}: {pill_user_ids: number[]}): void {
}) })
.safeParse(xhr.responseJSON); .safeParse(xhr.responseJSON);
if (failure_response_schema.success) { if (parsed.success) {
message = failure_response_schema.data.msg; message = parsed.data.msg;
} }
show_stream_subscription_request_result({ show_stream_subscription_request_result({
message, message,