feat: add i18n and avatar upload

This commit is contained in:
Vaka.pro
2026-04-26 22:16:59 +03:00
parent db41d4a246
commit 1b23097b18
22 changed files with 750 additions and 145 deletions

View File

@@ -24,7 +24,20 @@ export const updateProfileSchema = z.object({
.optional(),
displayName: z.string().trim().min(1).max(64).optional(),
bio: z.string().trim().max(500).nullable().optional(),
avatarUrl: z.string().url().nullable().optional(),
avatarUrl: z
.preprocess(
(value) => (value === '' ? null : value),
z
.string()
.refine(
(value) => value.startsWith('/uploads/avatar/') || z.string().url().safeParse(value).success,
{
message: 'Avatar must be a URL or an uploaded avatar path',
},
)
.nullable(),
)
.optional(),
});
export type UpdateProfileInput = z.infer<typeof updateProfileSchema>;