Se agregaron cambios en vucem y settings
This commit is contained in:
@@ -243,13 +243,13 @@ const Settings = () => {
|
||||
|
||||
setSaving(true);
|
||||
try {
|
||||
// Preparar datos para enviar - NO incluir grupos para preservarlos
|
||||
// Preparar datos para enviar - NO incluir grupos ni RFC para preservarlos
|
||||
const updateData = {
|
||||
first_name: formData.first_name.trim(),
|
||||
last_name: formData.last_name.trim(),
|
||||
email: formData.email.trim(),
|
||||
// Username NO se incluye - no se puede modificar
|
||||
...(formData.rfc.trim() && { rfc: formData.rfc.trim() }), // Solo incluir RFC si existe
|
||||
// RFC NO se incluye - no se puede modificar
|
||||
is_importador: currentUser.is_importador, // Preservar estado actual
|
||||
is_active: currentUser.is_active // Preservar estado actual
|
||||
};
|
||||
@@ -336,9 +336,8 @@ const Settings = () => {
|
||||
return (
|
||||
formData.first_name !== (currentUser.first_name || '') ||
|
||||
formData.last_name !== (currentUser.last_name || '') ||
|
||||
formData.email !== (currentUser.email || '') ||
|
||||
// Username excluded from change detection - field is read-only
|
||||
formData.rfc !== (currentUser.rfc || '')
|
||||
formData.email !== (currentUser.email || '')
|
||||
// RFC excluded from change detection - field is read-only
|
||||
);
|
||||
};
|
||||
|
||||
@@ -543,10 +542,13 @@ const Settings = () => {
|
||||
type="text"
|
||||
name="rfc"
|
||||
value={formData.rfc}
|
||||
onChange={handleInputChange}
|
||||
className="w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-all duration-200 hover:border-gray-400"
|
||||
disabled
|
||||
className="w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm bg-gray-50 text-gray-500 cursor-not-allowed text-sm"
|
||||
placeholder="XXXX000000XXX"
|
||||
/>
|
||||
<p className="text-xs text-gray-500">
|
||||
El RFC no puede ser modificado por razones de seguridad
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -576,13 +578,13 @@ const Settings = () => {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
// Resetear formulario a los valores originales (username no se resetea porque no se puede cambiar)
|
||||
// Resetear formulario a los valores originales (username y RFC no se resetean porque no se pueden cambiar)
|
||||
setFormData({
|
||||
first_name: currentUser?.first_name || '',
|
||||
last_name: currentUser?.last_name || '',
|
||||
email: currentUser?.email || '',
|
||||
username: currentUser?.username || '', // Mantener valor original
|
||||
rfc: currentUser?.rfc || ''
|
||||
rfc: currentUser?.rfc || '' // Mantener valor original
|
||||
});
|
||||
}}
|
||||
disabled={saving}
|
||||
|
||||
Reference in New Issue
Block a user