refactor zo zod and felte

This commit is contained in:
Christian Beutel
2024-12-30 19:52:44 +01:00
parent 75c94a3ce4
commit 871481a84e
45 changed files with 659 additions and 1040 deletions

View File

@@ -36,7 +36,7 @@ class Trail {
}
tags?: string[];
description?: string;
author?: string;
author: string;
constructor(name: string,
params?: {
@@ -70,10 +70,10 @@ class Trail {
this.location = params?.location;
this.date = params?.date ?? new Date().toISOString().split('T')[0];
this.public = params?.public ?? false
this.distance = params?.distance;
this.elevation_gain = params?.elevation_gain;
this.elevation_loss = params?.elevation_loss;
this.duration = params?.duration;
this.distance = params?.distance ?? 0;
this.elevation_gain = params?.elevation_gain ?? 0;
this.elevation_loss = params?.elevation_loss ?? 0;
this.duration = params?.duration ?? 0;
this.difficulty = params?.difficulty ?? "easy";
this.lat = params?.lat;
this.lon = params?.lon;
@@ -92,6 +92,7 @@ class Trail {
this.tags = params?.tags ?? []
this.description = params?.description ?? "";
this.created = params?.created;
this.author = "000000000000000"
}
}