fixed api url

This commit is contained in:
Tim Lappe 2025-04-26 03:50:13 +02:00
parent e23add8881
commit 4448740277

View File

@ -78,6 +78,7 @@ export async function del<T>(endpoint: string, options?: RequestOptions): Promis
function buildUrl(endpoint: string, params?: Record<string, string | number | boolean>): string { function buildUrl(endpoint: string, params?: Record<string, string | number | boolean>): string {
const url = new URL(`${API_BASE_URL}${endpoint}`); const url = new URL(`${API_BASE_URL}${endpoint}`);
url.port = window.location.port; url.port = window.location.port;
url.protocol = window.location.protocol;
if (params) { if (params) {
Object.entries(params).forEach(([key, value]) => { Object.entries(params).forEach(([key, value]) => {