From 2d6e7dbb37dc6fffb21e4efbca5fa9b639ba898d Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Mon, 18 Apr 2022 15:59:09 +0100 Subject: [PATCH] Add clients/read.php API endpoint. Adjust asset create/update so that they function without all attributes being provided. Update will default to using the value currently in the database, rather than overwriting blank. --- api/v1/assets/asset_model.php | 27 -------- api/v1/assets/create.php | 91 ++++++++++++++++++++++++- api/v1/assets/update.php | 121 ++++++++++++++++++++++++++++++++++ api/v1/clients/read.php | 24 +++++++ api/v1/update_output.php | 2 +- 5 files changed, 235 insertions(+), 30 deletions(-) delete mode 100644 api/v1/assets/asset_model.php create mode 100644 api/v1/assets/update.php create mode 100644 api/v1/clients/read.php diff --git a/api/v1/assets/asset_model.php b/api/v1/assets/asset_model.php deleted file mode 100644 index feb177ba..00000000 --- a/api/v1/assets/asset_model.php +++ /dev/null @@ -1,27 +0,0 @@ - 0){ // 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 update query failed/returned no results. Ensure ALL required variables are provided and database schema is up-to-date. Most likely cause: non-existent module (contact/ticket/etc) id"; + $return_arr['message'] = "Auth success but update query failed/returned no results. Ensure ALL required variables are provided and database schema is up-to-date. Most likely cause: non-existent module ID (contact ID/ticket ID/etc)"; } echo json_encode($return_arr);