www/api/delete_device.php
2026-06-27 21:35:49 +00:00

17 lines
368 B
PHP

<?php
declare(strict_types=1);
require __DIR__ . '/db.php';
$data = json_decode(file_get_contents("php://input"), true);
if (!$data || !isset($data['uid'])) {
http_response_code(400);
echo json_encode(["error"=>"invalid"]);
exit;
}
$uid = $data['uid'];
$pdo->prepare("DELETE FROM contadores WHERE uid=?")->execute([$uid]);
echo json_encode(["ok"=>1]);