typescript-typenfehler behoben.. npm run lint läuft nun fehlerfrei durch.

This commit is contained in:
Codex Agent
2025-11-22 11:49:47 +01:00
parent 6c78d7e281
commit eb41cb6194
74 changed files with 469 additions and 396 deletions

View File

@@ -5,7 +5,7 @@ export async function createUpload(
it: QueueItem,
deviceId: string,
onProgress?: (percent: number) => void
): Promise<any> {
): Promise<Record<string, unknown>> {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.open('POST', url, true);
@@ -22,7 +22,12 @@ export async function createUpload(
};
xhr.onload = () => {
if (xhr.status >= 200 && xhr.status < 300) {
try { resolve(JSON.parse(xhr.responseText)); } catch { resolve({}); }
try {
resolve(JSON.parse(xhr.responseText));
} catch (error) {
console.warn('Upload response parse failed', error);
resolve({});
}
} else {
reject(new Error('upload failed'));
}