<?php
// =====================================================
// POST /delete_issue.php
// Params: id
// Response: { status }
// =====================================================
require_once 'config.php';

$conn = getConnection();

$id = $_POST['id'] ?? '';

if (empty($id)) {
    echo json_encode(["status" => "error"]);
    exit;
}

$stmt = $conn->prepare("DELETE FROM issue WHERE id = ?");
$stmt->bind_param("i", $id);

if ($stmt->execute()) {
    echo json_encode(["status" => "success"]);
} else {
    echo json_encode(["status" => "error"]);
}

$stmt->close();
$conn->close();
