Update user profile to allow optional email and correct name updates

Fix bug where email was mandatory on user profile updates and ensure last name field updates correctly.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a8a78c07-e900-425c-a577-5b4c5894379d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a8a78c07-e900-425c-a577-5b4c5894379d/vetH0Gp
This commit is contained in:
michaelschal committed 2025-08-11 18:29:29 +00:00
1 parent d85d62a5da
commit a3b457f990
3 files changed
+3 -4

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

+2 -3
View File
@@ -917,14 +917,13 @@ export default function UsersPage() {
</div>
<div>
<Label htmlFor="edit-email">Email *</Label>
<Label htmlFor="edit-email">Email</Label>
<Input
id="edit-email"
type="email"
value={editForm.email}
onChange={(e) => setEditForm({...editForm, email: e.target.value})}
placeholder="email@exemple.com"
required
placeholder="email@exemple.com (optionnel)"
/>
</div>
+1 -1
View File
@@ -937,7 +937,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
role: z.enum(['admin', 'manager', 'employee']).optional(),
firstName: z.string().optional(),
lastName: z.string().optional(),
email: z.string().email().optional(),
email: z.union([z.string().email(), z.literal("")]).optional(),
password: z.string().optional(),
});