refactor(control): undo last commit

This commit is contained in:
E44
2026-01-04 23:01:10 +01:00
parent 8b41711df8
commit a2c1f385c1
@@ -209,6 +209,9 @@ async function request(
): Promise<RequestResponse> { ): Promise<RequestResponse> {
try { try {
const cache_buster = `${url.includes('?') ? '&' : '?'}=${Date.now()}`; const cache_buster = `${url.includes('?') ? '&' : '?'}=${Date.now()}`;
if (dev) {
console.debug('Sending request: ', url + cache_buster, 'with', options.body ?? 'none');
}
const response = await fetch(url + cache_buster, options); const response = await fetch(url + cache_buster, options);
if (response.ok || supress_error_handling_http_codes.includes(response.status)) { if (response.ok || supress_error_handling_http_codes.includes(response.status)) {
const contentType = response.headers.get('content-type') || ''; const contentType = response.headers.get('content-type') || '';
@@ -219,6 +222,9 @@ async function request(
} else { } else {
const json: Record<string, unknown> = await response.json(); const json: Record<string, unknown> = await response.json();
request_response = { ok: response.ok, http_code: response.status, json: json }; request_response = { ok: response.ok, http_code: response.status, json: json };
if (dev) {
console.debug(request_response);
}
} }
return request_response; return request_response;
} }