Actualiser api.php
This commit is contained in:
@@ -157,7 +157,13 @@ switch ($action) {
|
||||
|
||||
$stmt = $pdo->prepare("DELETE FROM $table WHERE 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]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'bulk_delete':
|
||||
|
||||
Reference in New Issue
Block a user