web: Fix nonsensical use of TypeScript Omit<>.

Omit<…, "undefined"> removes the "undefined" key from an object.  The
intention was clearly Exclude<…, undefined> which removes undefined
from a union, or NonNullable<…> which removes both undefined and null.
However, it’s simpler here to provide the expected type directly.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2025-05-05 11:20:25 -07:00
committed by Tim Abbott
parent 24c469f9c9
commit 8f6c376835
2 changed files with 2 additions and 2 deletions

View File

@@ -259,7 +259,7 @@ export function launch(conf: DialogWidgetConfig): string {
export function submit_api_request(
request_method: AjaxRequestHandler,
url: string,
data: Omit<Parameters<AjaxRequestHandler>[0]["data"], "undefined">,
data: Record<string, unknown>,
{
failure_msg_html = $t_html({defaultMessage: "Failed"}),
success_continuation,

View File

@@ -35,7 +35,7 @@ export const strings = {
export function do_settings_change(
request_method: AjaxRequestHandler,
url: string,
data: Omit<Parameters<AjaxRequestHandler>[0]["data"], "undefined">,
data: Record<string, unknown>,
$status_element: JQuery,
{
success_msg_html = strings.success_html,