<?php
require_once __DIR__ . "/../../config/db.php";

$id = (int)($_POST['id'] ?? 0);

if (!$id) {
    echo json_encode(['success' => false]);
    exit;
}

$stmt = $conn->prepare("UPDATE devis SET statut='refuse' WHERE id=?");
$stmt->execute([$id]);

echo json_encode(['success' => true]);