From 7442e0c2c8d9a337408ad629ed1c3cc2d9f6ea9a Mon Sep 17 00:00:00 2001 From: wrongecho <32306651+wrongecho@users.noreply.github.com> Date: Mon, 31 Aug 2026 21:42:07 +0100 Subject: [PATCH] Move interface deletion inside delete check otherwise the count is of the interfaces not the asset --- api/v1/assets/delete.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/v1/assets/delete.php b/api/v1/assets/delete.php index 323fb0795..fc16c8f85 100644 --- a/api/v1/assets/delete.php +++ b/api/v1/assets/delete.php @@ -17,13 +17,13 @@ if (!empty($asset_id)) { $delete_sql = mysqli_query($mysqli, "DELETE FROM assets WHERE asset_id = $asset_id AND asset_client_id = $client_id LIMIT 1"); - // Delete Interfaces - mysqli_query($mysqli,"DELETE FROM asset_interfaces WHERE interface_asset_id = $asset_id"); - // Check delete & get affected rows if ($delete_sql && !empty($asset_name)) { $delete_count = mysqli_affected_rows($mysqli); + // Delete Interfaces + mysqli_query($mysqli,"DELETE FROM asset_interfaces WHERE interface_asset_id = $asset_id"); + // Logging logAudit("Asset", "Delete", "$asset_name via API ($api_key_name)", $client_id); }