From 273c010f169f807672ea93b7ce27f34d0d118276 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Tue, 29 Jun 2021 10:00:44 +0200 Subject: [PATCH] Make `failure` parameter of `Popover.ajaxApi()` optional There is no reason to make the custom failure callback a required parameter here because in most cases, there is no need fur such a custom handler. --- ts/WoltLabSuite/Core/Controller/Popover.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/WoltLabSuite/Core/Controller/Popover.ts b/ts/WoltLabSuite/Core/Controller/Popover.ts index 6bd30fd307..fb798ede51 100644 --- a/ts/WoltLabSuite/Core/Controller/Popover.ts +++ b/ts/WoltLabSuite/Core/Controller/Popover.ts @@ -433,7 +433,7 @@ class ControllerPopover implements AjaxCallbackObject { /** * Sends an AJAX requests to the server, simple wrapper to reuse the request object. */ - ajaxApi(data: RequestPayload, success: CallbackSuccess, failure: CallbackFailure): void { + ajaxApi(data: RequestPayload, success: CallbackSuccess, failure?: CallbackFailure): void { if (typeof success !== "function") { throw new TypeError("Expected a valid callback for parameter 'success'."); } -- 2.20.1