diff --git a/templates/index.html b/templates/index.html index 87d314a..98bb742 100644 --- a/templates/index.html +++ b/templates/index.html @@ -312,59 +312,52 @@ if (query) params.append('q', query); fetch(`/search?${params.toString()}`) - .then(response => { - if (!response.ok) { - return response.json().then(data => { - throw new Error(data.error || 'Ein Fehler ist aufgetreten'); - }); - } - return response.json(); - }) + .then(response => response.json()) .then(data => { - const resultsDiv = document.getElementById('results'); - resultsDiv.innerHTML = ''; - - if (data.length === 0) { - resultsDiv.innerHTML = '
- Kundennummer: ${customer.Nummer}
- Fachrichtung: ${customer.Fachrichtung || 'N/A'}
- Adresse: ${createAddressLink(customer.Strasse, customer.PLZ, customer.Ort)}
- ${customer.weather ? `
-
-
- ${customer.weather.temperature}°C
-
- ` : ''}
-
- Telefon: ${createPhoneLink(customer.Tel)}
- E-Mail: ${createEmailLink(customer.mail)}
-
+ Kundennummer: ${customer.Nummer}
+ Fachrichtung: ${customer.Fachrichtung || 'N/A'}
+ Adresse: ${createAddressLink(customer.Strasse, customer.PLZ, customer.Ort)}
+ ${customer.weather ? `
+
+
+ ${customer.weather.temperature}°C
+
+ ` : ''}
+
+ Telefon: ${createPhoneLink(customer.Tel)}
+ E-Mail: ${createEmailLink(customer.mail)}
+