false, 'ERROR' => 'no_business_selected']); } $servicePointId = (int) ($data['ServicePointID'] ?? 0); if ($servicePointId <= 0) { apiAbort(['OK' => false, 'ERROR' => 'missing_service_point_id', 'MESSAGE' => 'ServicePointID is required']); } queryTimed(" UPDATE ServicePoints SET BeaconMinor = NULL WHERE ID = ? AND BusinessID = ? ", [$servicePointId, $bizId]); $qCheck = queryOne(" SELECT ID FROM ServicePoints WHERE ID = ? AND BusinessID = ? LIMIT 1 ", [$servicePointId, $bizId]); if (!$qCheck) { apiAbort(['OK' => false, 'ERROR' => 'not_found', 'DEBUG_ServicePointID' => $servicePointId, 'DEBUG_BusinessID' => $bizId]); } jsonResponse(['OK' => true, 'ERROR' => '', 'ServicePointID' => $servicePointId]);