add searching, total unread message, create user

This commit is contained in:
richardtekula
2025-11-19 08:45:37 +01:00
parent da01d586fc
commit 97f437c1c4
8 changed files with 1338 additions and 90 deletions

View File

@@ -58,7 +58,8 @@ export const linkEmailSchema = z.object({
});
// Create user schema (admin only)
// Create user schema (admin only) - temp password sa generuje automaticky
// Ak je poskytnutý email, môže byť poskytnuté aj emailPassword pre automatické nastavenie JMAP
export const createUserSchema = z.object({
username: z
.string({
@@ -70,15 +71,8 @@ export const createUserSchema = z.object({
/^[a-zA-Z0-9_-]+$/,
'Username môže obsahovať iba písmená, čísla, pomlčky a podčiarkovníky'
),
tempPassword: z
.string({
required_error: 'Dočasné heslo je povinné',
})
.min(8, 'Dočasné heslo musí mať aspoň 8 znakov'),
role: z.enum(['admin', 'member'], {
required_error: 'Rola je povinná',
invalid_type_error: 'Neplatná rola',
}),
email: z.string().email('Neplatný formát emailu').max(255).optional(),
emailPassword: z.string().min(1).optional(),
firstName: z.string().max(100).optional(),
lastName: z.string().max(100).optional(),
});