Refactor software version update logic into a reusable function; enhance UI for file uploads and table responsiveness
This commit is contained in:
@@ -44,7 +44,7 @@ $filter_version_id = $_GET['from_version_id'] ?? $_GET['to_version_id'] ?? $_GET
|
||||
if (isset($_GET['id']) && $_GET['id'] != '') {
|
||||
$api_url = '/v2/products_software_upgrade_paths/rowID=' . $_GET['id'];
|
||||
$response = ioServer($api_url, '');
|
||||
var_dump($response);
|
||||
|
||||
if (!empty($response)) {
|
||||
$existing = json_decode($response);
|
||||
if (!empty($existing)) {
|
||||
@@ -145,7 +145,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$api_url = '/v2/products_software_upgrade_paths/';
|
||||
$result = ioServer($api_url, json_encode($data));
|
||||
|
||||
if ($result) {
|
||||
if ($result !== 'NOK') {
|
||||
$success = isset($_POST['delete']) ? 3 : (isset($_POST['rowID']) && $_POST['rowID'] != '' ? 2 : 1);
|
||||
header('Location: ' . $url . '&success_msg=' . $success);
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user