feat: Healthcheck um Webservices, API-Routen und .env-Prüfungen erweitert
- Externe Webservices von TALAS V5 integriert und geprüft (Statuscode + Antwortstruktur) - Eigene API-Endpunkte wie /api/talas_v5_DB/getDevices hinzugefügt und validiert - Prüfung von NEXT_PUBLIC_USE_MOCKS zur Vermeidung von Mockdaten in Produktion - Validierung der Umgebungsvariablen wie DB_HOST, DB_NAME und NODE_ENV ergänzt - Response-Status 200 bei vollständigem Erfolg, 207 bei Teilfehlern - Verbesserung der JSON-Antwortstruktur zur einfacheren Analyse
This commit is contained in:
@@ -13,9 +13,12 @@ export default async function handler(req, res) {
|
||||
return res.status(400).json({ error: "Fehlende Daten" });
|
||||
}
|
||||
|
||||
const newLineString = `LINESTRING(${newCoordinates.map((coord) => `${coord[0]} ${coord[1]}`).join(",")})`;
|
||||
const newLineString = `LINESTRING(${newCoordinates
|
||||
.map(coord => `${coord[0]} ${coord[1]}`)
|
||||
.join(",")})`;
|
||||
|
||||
const query = "UPDATE talas_v5.gis_lines SET points = ST_GeomFromText(?) WHERE idLD = ? AND idModul = ?;";
|
||||
const query =
|
||||
"UPDATE talas_v5.gis_lines SET points = ST_GeomFromText(?) WHERE idLD = ? AND idModul = ?;";
|
||||
|
||||
let connection;
|
||||
|
||||
@@ -31,8 +34,9 @@ export default async function handler(req, res) {
|
||||
|
||||
// Commit der Transaktion
|
||||
await connection.commit();
|
||||
|
||||
console.log("Transaction Complete.");
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
console.log("Transaction Complete.");
|
||||
}
|
||||
res.status(200).json({
|
||||
success: "Updated successfully.",
|
||||
affectedRows: results.affectedRows,
|
||||
|
||||
Reference in New Issue
Block a user