<?php
require_once 'config.php';

checkAccess(['admin', 'programmer', 'board']);

$data = json_decode(file_get_contents("php://input"), true);

try {
    $stmt = $pdo->prepare("UPDATE live_votes SET status = ? WHERE id = ?");
    $stmt->execute([$data['status'], $data['id']]);
    response(["success" => true]);
} catch (PDOException $e) {
    response(["error" => $e->getMessage()], 500);
}
?>