<?php

require_once '../config/database.php';

$db = getDB();

$deviceId =
$_POST['device_id'] ?? '';

$productId =
intval($_POST['product_id'] ?? 0);

$db->query("

DELETE FROM favorites

WHERE device_id = '$deviceId'

AND product_id = $productId
");

echo json_encode([

    "success" => true
]);