Accept the `URL` object for `prepareRequest()`
authorAlexander Ebert <ebert@woltlab.com>
Wed, 24 Jan 2024 16:30:36 +0000 (17:30 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 25 Jan 2024 15:29:59 +0000 (16:29 +0100)
ts/WoltLabSuite/Core/Ajax/Backend.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Backend.js

index c4b4e0dfe0fdd051233ea9845cc806250f57c1e0..aaf9843ca9d3ed907188ce13ffea5458026ec51a 100644 (file)
@@ -197,6 +197,6 @@ class GetRequest extends BackendRequest {
   }
 }
 
-export function prepareRequest(url: string): SetupRequest {
-  return new SetupRequest(url);
+export function prepareRequest(url: string | URL): SetupRequest {
+  return new SetupRequest(url.toString());
 }
index 70571b143c2db3e7417e8bdbb83c58a0a4c4bbd5..b4f0cfaf52ac3b76d567919942289fafbecb75a6 100644 (file)
@@ -155,7 +155,7 @@ define(["require", "exports", "tslib", "./Status", "./Error", "../Core"], functi
         }
     }
     function prepareRequest(url) {
-        return new SetupRequest(url);
+        return new SetupRequest(url.toString());
     }
     exports.prepareRequest = prepareRequest;
 });