Files
fotospiel-app/resources/js/guest-v2/lib/routes.ts
2026-02-02 13:01:20 +01:00

14 lines
323 B
TypeScript

export function buildEventPath(token: string | null, path: string): string {
const normalized = path.startsWith('/') ? path : `/${path}`;
if (!token) {
return normalized;
}
if (normalized === '/') {
return `/e/${encodeURIComponent(token)}`;
}
return `/e/${encodeURIComponent(token)}${normalized}`;
}