Fehlermeldungen hinzugefügt, wenn Verbindung zur API nicht klappt

This commit is contained in:
R40fendt
2026-01-28 18:43:30 +01:00
parent 59e2a2693c
commit f04b4089f7
27 changed files with 194 additions and 137 deletions

View File

@@ -50,6 +50,13 @@ class RitzenbergenLib {
return apiBaseUrl + path;
else return apiBaseUrl+"/" + path;
}
static async checkInternetConnection(): Promise<boolean> {
try{
return await fetch(this.api("/addhit.php")).then((response)=>response.ok);
} catch(e){
return false;
}
}
}
class Paarung {
@@ -171,6 +178,7 @@ class Formular {
}
public static async getForms(): Promise<Formular[]> {
let forms: Formular[] = [];
try{
forms = await fetch(
RitzenbergenLib.api("/formulare/get_formulare.php"),
{
@@ -191,6 +199,9 @@ class Formular {
)
);
} catch(e){
console.warn(e);
}
return forms;
}
private async getFields(): Promise<Field[]> {