feat: add first_name and last_name to users and implement inline editing in user-list
All checks were successful
Staging Build / build (push) Successful in 2m40s

This commit is contained in:
DanielS
2026-06-25 01:38:07 +02:00
parent 30a9de0e6d
commit 07c2758b73
3 changed files with 121 additions and 5 deletions

View File

@@ -31,6 +31,8 @@ const userSchema = z.object({
email: z.string().email('Ungültige E-Mail-Adresse'),
role: z.enum(['admin', 'partner']),
company_id: z.string().optional().or(z.literal('')),
first_name: z.string().optional().or(z.literal('')),
last_name: z.string().optional().or(z.literal('')),
})
type UserFormValues = z.infer<typeof userSchema>
@@ -63,6 +65,8 @@ export function UserDialog({ companies }: UserDialogProps) {
email: '',
role: 'partner',
company_id: '',
first_name: '',
last_name: '',
},
})
@@ -72,6 +76,8 @@ export function UserDialog({ companies }: UserDialogProps) {
email: values.email,
role: values.role,
company_id: values.company_id || undefined,
first_name: values.first_name || undefined,
last_name: values.last_name || undefined,
}
await createUser(payload)
setOpen(false)
@@ -119,6 +125,34 @@ export function UserDialog({ companies }: UserDialogProps) {
</FormItem>
)}
/>
<div className="grid grid-cols-2 gap-4">
<FormField
control={form.control}
name="first_name"
render={({ field }) => (
<FormItem>
<FormLabel className="text-white">Vorname</FormLabel>
<FormControl>
<Input placeholder="Vorname" className="bg-white/5 border-white/10 text-white" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="last_name"
render={({ field }) => (
<FormItem>
<FormLabel className="text-white">Nachname</FormLabel>
<FormControl>
<Input placeholder="Nachname" className="bg-white/5 border-white/10 text-white" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</div>
<FormField
control={form.control}
name="role"