Typos in API code fixed
This commit is contained in:
@@ -11,7 +11,7 @@ if ($API_devices->request_method === 'POST') {
|
||||
|
||||
$API_devices->checkPermissions('admin-devices-files', 'RW');
|
||||
|
||||
# when called from the frontend will not be forwarding to a url since when its called from the frontend it doesnt need a redirection
|
||||
# when called from the frontend will not be forwarding to a url since when it's called from the frontend it doesn't need a redirection
|
||||
$API_devices->return_url = false;
|
||||
|
||||
$device_slugify = isset($_POST['device_slugify']) ? preg_replace('/[^a-zA-Z0-9_-]/', '_', $_POST['device_slugify']) : '';
|
||||
@@ -61,7 +61,7 @@ if ($API_devices->request_method === 'POST') {
|
||||
|
||||
if (move_uploaded_file($_FILES['file']['tmp_name'], $destination)) {
|
||||
chmod($destination, 0644); // Set safe permissions
|
||||
$API_devices->apiOutput(200, ['success' => 'File uploaded succcessfully']);
|
||||
$API_devices->apiOutput(200, ['success' => 'File uploaded successfully']);
|
||||
} else {
|
||||
$API_devices->apiOutput(500, ['error' => 'Failed to move uploaded file']);
|
||||
}
|
||||
@@ -70,7 +70,7 @@ if ($API_devices->request_method === 'POST') {
|
||||
|
||||
$API_devices->checkPermissions('admin-devices-files', 'RW');
|
||||
|
||||
# when called from the frontend will not be forwarding to a url since when its called from the frontend it doesnt need a redirection
|
||||
# when called from the frontend will not be forwarding to a url since when it's called from the frontend it doesn't need a redirection
|
||||
$API_devices->return_url = false;
|
||||
|
||||
$relativePath = $_POST['file_name'] ?? '';
|
||||
|
||||
@@ -16,7 +16,7 @@ if ($API_devices->request_method === 'GET') {
|
||||
|
||||
} elseif ($API_devices->request_method === 'POST') {
|
||||
|
||||
# create an new device
|
||||
# create a new device
|
||||
|
||||
$API_devices->checkPermissions('admin-devices', 'RW');
|
||||
|
||||
@@ -106,7 +106,7 @@ if ($API_devices->request_method === 'GET') {
|
||||
|
||||
$API_devices->checkPermissions('admin-devices', 'RW');
|
||||
|
||||
# when called from the frontend will not be forwarding to a url since when its called from the frontend it doesnt need a redirection
|
||||
# when called from the frontend will not be forwarding to a url since when it's called from the frontend it doesn't need a redirection
|
||||
$API_devices->return_url = false;
|
||||
|
||||
$requiredFields = ['device_uuid' => ['type' => 'uuid']];
|
||||
|
||||
Reference in New Issue
Block a user