moves bio to settings

This commit is contained in:
Christian Beutel
2025-01-20 16:58:43 +01:00
parent f6a0281e6e
commit 9d8a8e2ebb
9 changed files with 252 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ import type { Settings } from "../settings";
const SettingsCreateSchema = z.object({
unit: z.enum(["metric", "imperial"]).optional(),
language: z.enum(["en", "de", "es", "fr", "hu", "it", "nl", "pl", "pt", "zh"]).optional(),
bio: z.string().optional(),
mapFocus: z.enum(["trails", "location"]).optional(),
location: z.object({
name: z.string(),

View File

@@ -18,7 +18,6 @@ const UserUpdateSchema = (z.object({
password: z.string().min(8, "must-be-at-least-n-characters-long").optional(),
oldPassword: z.string().min(8, "must-be-at-least-n-characters-long").optional(),
passwordConfirm: z.string().min(8, "must-be-at-least-n-characters-long").optional(),
bio: z.string().optional()
}) satisfies ZodType<Partial<User>>).refine((data) => data.password === data.passwordConfirm, {
message: "passwords-must-match",
path: ["passwordConfirm"],

View File

@@ -4,6 +4,7 @@ class Settings {
id?: string;
unit?: "metric" | "imperial";
language?: "en" | "de" | "es" | "fr" | "hu" | "it" | "nl" | "pl" | "pt" | "zh";
bio?: string;
mapFocus?: "trails" | "location";
location?: { name: string, lat: number, lon: number };
category?: string;

View File

@@ -14,7 +14,6 @@ export type UserAnonymous = {
id: string,
username?: string,
avatar?: string;
bio?: string;
created?: string;
private: boolean;
}