fixes default language after signup
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { z, ZodType } from "zod";
|
||||
import { NotificationType } from "../notification";
|
||||
import type { Settings } from "../settings";
|
||||
import { Language, 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(),
|
||||
language: z.enum(Object.values(Language) as [Language, ...Language[]]).optional(),
|
||||
bio: z.string().optional(),
|
||||
mapFocus: z.enum(["trails", "location"]).optional(),
|
||||
location: z.object({
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
import type { NotificationType } from "./notification";
|
||||
|
||||
export enum Language {
|
||||
en = "en",
|
||||
de = "de",
|
||||
es = "es",
|
||||
fr = "fr",
|
||||
hu = "hu",
|
||||
it = "it",
|
||||
nl = "nl",
|
||||
pl = "pl",
|
||||
pt = "pt",
|
||||
zh = "zh"
|
||||
}
|
||||
|
||||
class Settings {
|
||||
id?: string;
|
||||
unit?: "metric" | "imperial";
|
||||
language?: "en" | "de" | "es" | "fr" | "hu" | "it" | "nl" | "pl" | "pt" | "zh";
|
||||
language?: Language;
|
||||
bio?: string;
|
||||
mapFocus?: "trails" | "location";
|
||||
location?: { name: string, lat: number, lon: number };
|
||||
@@ -16,7 +29,7 @@ class Settings {
|
||||
|
||||
constructor(
|
||||
unit: "metric" | "imperial",
|
||||
language: "en" | "de" | "es" | "fr" | "hu" | "it" | "nl" | "pl" | "pt" | "zh",
|
||||
language: Language,
|
||||
mapFocus: "trails" | "location",
|
||||
user: string,
|
||||
params?: {
|
||||
|
||||
Reference in New Issue
Block a user