cleanup test structure
Sonarqube Scanner / Build and analyze (push) Failing after 1m29s

This commit is contained in:
Florian Zumpe
2026-06-17 14:47:29 +02:00
parent b9f3417aa8
commit 2442f8d458
5 changed files with 1199 additions and 16 deletions
+4 -5
View File
@@ -57,12 +57,11 @@ export function getRouteGpxFile(db, id) {
export function createRoute(db, fields, gpxFile) {
if (!gpxFile) throw new HttpError(400, 'Eine GPX-Datei ist erforderlich.');
const parsed = parseGpx(fs.readFileSync(gpxFile.path, 'utf8'));
const name = String(fields.name || parsed.name || '').trim();
if (!name) throw new HttpError(400, 'Ein Streckenname ist erforderlich.');
let routeId;
let finalGpx;
try {
const parsed = parseGpx(fs.readFileSync(gpxFile.path, 'utf8'));
const name = String(fields.name || parsed.name || '').trim();
if (!name) throw new HttpError(400, 'Ein Streckenname ist erforderlich.');
routeId = transaction(db, () => {
let slug = slugify(fields.slug || name);
let suffix = 2;
@@ -79,7 +78,7 @@ export function createRoute(db, fields, gpxFile) {
return id;
});
ensureRouteDirectories(routeId);
finalGpx = path.join(routeDirectory(routeId), 'route.gpx');
const finalGpx = path.join(routeDirectory(routeId), 'route.gpx');
const gpxPath = moveUploadedFile(gpxFile, finalGpx);
db.prepare("UPDATE routes SET gpx_path = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ?").run(gpxPath, routeId);
return getRoute(db, routeId);