Actualiser api.php

This commit is contained in:
2026-06-18 16:55:28 +02:00
parent c3418f0fbc
commit 27ba709f02
+6
View File
@@ -157,7 +157,13 @@ switch ($action) {
$stmt = $pdo->prepare("DELETE FROM $table WHERE id = ?"); $stmt = $pdo->prepare("DELETE FROM $table WHERE id = ?");
$stmt->execute([$id]); $stmt->execute([$id]);
if ($stmt->rowCount() === 0) {
http_response_code(404);
echo json_encode(["error" => "Aucun enregistrement trouvé avec cet ID."]);
} else {
echo json_encode(["success" => true]); echo json_encode(["success" => true]);
}
break; break;
case 'bulk_delete': case 'bulk_delete':