mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	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:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							24c469f9c9
						
					
				
				
					commit
					8f6c376835
				
			@@ -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,
 | 
			
		||||
 
 | 
			
		||||
@@ -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,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user