curl --request POST \
--url https://api.example.com/api/solicitudes/actualizacion-perfil \
--header 'Content-Type: application/json' \
--data '
{
"telefono": "<string>",
"direccion": "<string>",
"img_perfil": "<string>"
}
'{
"message": "Debe proporcionar al menos un campo (teléfono, dirección o imagen) para actualizar."
}
Request changes to profile information (phone, address, or profile image)
curl --request POST \
--url https://api.example.com/api/solicitudes/actualizacion-perfil \
--header 'Content-Type: application/json' \
--data '
{
"telefono": "<string>",
"direccion": "<string>",
"img_perfil": "<string>"
}
'{
"message": "Debe proporcionar al menos un campo (teléfono, dirección o imagen) para actualizar."
}
POST /api/solicitudes/actualizacion-perfil
"+1234567890""123 Main St, City, Country""https://example.com/images/profile.jpg"const token = 'your_jwt_token';
const profileUpdate = {
telefono: '+1234567890',
direccion: '456 New Street, City, State',
img_perfil: 'https://example.com/images/new-profile.jpg'
};
const response = await fetch('/api/solicitudes/actualizacion-perfil', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(profileUpdate)
});
const data = await response.json();
console.log(data);
{
"mensaje": "Solicitud de actualización de perfil enviada correctamente para aprobación.",
"id_solicitud": 234
}
{
"message": "Debe proporcionar al menos un campo (teléfono, dirección o imagen) para actualizar."
}
actualizacion_perfil) linked to the main request:
// Proposed data structure
{
id_solicitud: 234,
datos_propuestos: {
telefono: '+1234567890',
direccion: '456 New Street, City, State',
img_perfil: 'https://example.com/images/new-profile.jpg'
}
}
/api/solicitudes/:id/aprobarAdmin approves the request and applies changes to employee profile/api/solicitudes/:id/rechazarAdmin rejects the request without applying changes// Update only phone number
{
"telefono": "+1234567890"
}
// Update only address
{
"direccion": "789 Another St, City"
}
// Update phone and address, keep current image
{
"telefono": "+1234567890",
"direccion": "789 Another St, City"
}