diff --git a/api/v1/assets/delete.php b/api/v1/assets/delete.php new file mode 100644 index 00000000..2ad4fc51 --- /dev/null +++ b/api/v1/assets/delete.php @@ -0,0 +1,28 @@ + 0){ + // Delete was successful + $return_arr['success'] = "True"; + $return_arr['count'] = $delete_count; +} + +// Delete query returned false: something went wrong, or it was declined due to required variables missing +else{ + $return_arr['success'] = "False"; + $return_arr['message'] = "Auth success but delete query failed. Ensure ALL required variables are provided and database schema is up-to-date. Most likely cause: asset/client/company ID mismatch."; +} + +echo json_encode($return_arr); +exit(); \ No newline at end of file diff --git a/api/v1/require_post_method.php b/api/v1/require_post_method.php index cb13d64b..45686e3a 100644 --- a/api/v1/require_post_method.php +++ b/api/v1/require_post_method.php @@ -10,6 +10,5 @@ if($_SERVER['REQUEST_METHOD'] !== "POST"){ // Client ID must be specific for INSERT/UPDATE/DELETE queries // If this API key allows any client, set $client_id to the one specified, else leave it if($client_id == 0){ - // $client_id = intval($_POST['client_id']); } \ No newline at end of file diff --git a/api/v1/update_output.php b/api/v1/update_output.php index f46ab173..942b71fa 100644 --- a/api/v1/update_output.php +++ b/api/v1/update_output.php @@ -7,10 +7,10 @@ */ // Check if the insert query was successful -if(isset($update_id) && is_numeric($update_id) && $update_id > 0){ +if(isset($update_count) && is_numeric($update_count) && $update_count > 0){ // Insert successful $return_arr['success'] = "True"; - $return_arr['count'] = $update_id; + $return_arr['count'] = $update_count; } // Query returned false: something went wrong, or it was declined due to required variables missing