adds tags

This commit is contained in:
Christian Beutel
2025-03-19 22:30:09 +01:00
parent 80275ee153
commit b261ada15c
37 changed files with 728 additions and 73 deletions

View File

@@ -1,6 +1,7 @@
import type { Category } from "./category";
import type { Comment } from "./comment";
import type { SummitLog } from "./summit_log";
import type { Tag } from "./tag";
import type { TrailShare } from "./trail_share";
import type { UserAnonymous } from "./user";
import type { Waypoint } from "./waypoint";
@@ -23,9 +24,11 @@ class Trail {
gpx?: string;
created?: string;
category?: string;
tags: string[];
waypoints: string[];
summit_logs: string[];
expand?: {
tags?: Tag[]
category?: Category;
waypoints?: Waypoint[]
summit_logs?: SummitLog[]
@@ -34,7 +37,6 @@ class Trail {
gpx_data?: string
trail_share_via_trail?: TrailShare[]
}
tags?: string[];
description?: string;
author: string;
@@ -81,6 +83,7 @@ class Trail {
this.photos = params?.photos ?? [];
this.waypoints = [];
this.summit_logs = [];
this.tags = []
this.gpx = params?.gpx;
this.expand = {
category: params?.category,
@@ -89,7 +92,6 @@ class Trail {
comments_via_trail: params?.comments ?? [],
trail_share_via_trail: params?.shares ?? []
}
this.tags = params?.tags ?? []
this.description = params?.description ?? "";
this.created = params?.created;
this.author = "000000000000000"
@@ -99,6 +101,7 @@ class Trail {
interface TrailFilter {
q: string,
category: string[],
tags: string[],
difficulty: ("easy" | "moderate" | "difficult")[]
author?: string;
public?: boolean;
@@ -163,6 +166,7 @@ interface TrailSearchResult {
public: boolean;
thumbnail: string;
shares?: string[];
tags?: string[]
gpx: string;
_geo: {
lat: number,