This commit is contained in:
Lizandro Guarnizo
2026-06-18 09:35:17 -05:00
parent c58998599b
commit 8d577947a6
7 changed files with 87 additions and 12 deletions
+4 -2
View File
@@ -14,6 +14,8 @@ $input = inputJson();
$id = (int)($input['id'] ?? 0);
$nombre = trim($input['nombre'] ?? '');
$color = trim($input['color'] ?? '#6b7280');
$icono = trim($input['icono'] ?? null) ?: null;
$descripcion = trim($input['descripcion'] ?? null) ?: null;
$ordenPeso = (int)($input['orden_peso'] ?? 1);
$activo = (int)($input['activo'] ?? 1);
@@ -23,9 +25,9 @@ if ($ordenPeso < 1) jsonError('El orden debe ser mayor a 0');
if (!preg_match('/^#[0-9a-f]{6}$/i', $color)) jsonError('Color hexadecimal inválido (formato: #RRGGBB)');
$stmt = db()->prepare(
'UPDATE turnero_prioridades SET nombre=?, color=?, orden_peso=?, activo=? WHERE id=?'
'UPDATE turnero_prioridades SET nombre=?, color=?, icono=?, descripcion=?, orden_peso=?, activo=? WHERE id=?'
);
$stmt->execute([$nombre, $color, $ordenPeso, $activo, $id]);
$stmt->execute([$nombre, $color, $icono, $descripcion, $ordenPeso, $activo, $id]);
if ($stmt->rowCount() === 0) {
jsonError('Prioridad no encontrada', 404);