fix: swap order of nome and cognome in username generation across forms and auth controller

This commit is contained in:
Marco Pedone 2026-03-10 12:27:51 +01:00
parent 09479eb9f2
commit 70c1902a36
3 changed files with 3 additions and 3 deletions

View file

@ -367,7 +367,7 @@ export const FormNewServizioAcquisto = ({
email: fields.email,
nome: fields.nome,
telefono: fields.telefono.replace(/\s/g, ""),
username: `${fields.nome.trim()} ${fields.cognome.trim()}`,
username: `${fields.cognome.trim()} ${fields.nome.trim()}`,
};
mutate({
anagrafica: a,

View file

@ -78,7 +78,7 @@ export const ProfileFormAccount = ({
data: {
...fields,
telefono: fields.telefono?.replace(/\s/g, ""),
username: `${fields.nome?.trim()} ${fields.cognome?.trim()}`,
username: `${fields.cognome?.trim()} ${fields.nome?.trim()}`,
isAdmin: fields.isAdmin || false,
},
});

View file

@ -53,7 +53,7 @@ export const createUserAdmin = async ({
password: hashedPassword,
salt,
telefono,
username: `${nome.trim()} ${cognome.trim()}`,
username: `${cognome.trim()} ${nome.trim()}`,
},
db,
});