fix:gis_Lines error 404 holt leere Array

This commit is contained in:
ISA
2025-03-17 12:11:29 +01:00
parent a1e33f650e
commit 154d310117
8 changed files with 10 additions and 9 deletions

View File

Binary file not shown.

Binary file not shown.

View File

@@ -1,2 +1,2 @@
// /config/appVersion
export const APP_VERSION = "1.1.58";
export const APP_VERSION = "1.1.59";

View File

@@ -4,8 +4,8 @@
# Tags als Variablen deklarieren
# $tag1 = "v1.0.0" # Ersetze durch deinen ersten Tag
# $tag2 = "v1.1.0" # Ersetze durch deinen zweiten Tag
$tag1 = "v1.0.18.0" # Ersetze durch deinen ersten Tag
$tag2 = "v1.0.19.1" # Ersetze durch deinen zweiten Tag
$tag1 = "v1.1.56" # Ersetze durch deinen ersten Tag
$tag2 = "v1.1.58" # Ersetze durch deinen zweiten Tag
# Aktuelles Datum und Uhrzeit für den Dateinamen
$currentDateTime = (Get-Date).ToString("dd.MM.yyyy_HH_mm")

Binary file not shown.

View File

@@ -16,11 +16,9 @@ export default async function handler(req, res) {
connection = await pool.getConnection();
// Abfrage ausführen
const [results] = await connection.query(query);
if (results.length > 0) {
res.status(200).json(results);
} else {
res.status(404).json({ error: "Keine Daten gefunden" });
}
// Immer 200 senden, auch wenn keine Daten vorhanden sind
res.status(200).json(results || []);
} catch (error) {
console.error("Fehler beim Abrufen der gis_lines:", error);
res.status(500).json({ error: "Fehler beim Abrufen der gis_lines" });

View File

@@ -4,7 +4,10 @@ const apiBaseUrl = process.env.NEXT_PUBLIC_API_BASE_URL;
export const fetchGisStationsStatic = async () => {
try {
const response = await fetch(`${apiBaseUrl}/GisStationsStatic?idMap=12`);
const params = new URLSearchParams(window.location.search);
const idMap = params.get("idMap") || process.env.NEXT_PUBLIC_DEFAULT_ID_MAP || "12";
const idUser = params.get("idUser") || process.env.NEXT_PUBLIC_DEFAULT_ID_USER || "484";
const response = await fetch(`${apiBaseUrl}/GisStationsStatic?idMap=${idMap}`);
//console.log("📡 API Response Status:", response.status);
//console.log("📡 API Response Headers:", response.headers.get("content-type"));