Typos in API code fixed

This commit is contained in:
2026-06-15 15:20:33 +02:00
parent 9dfb60fb9a
commit 7429cd367d
16 changed files with 55 additions and 50 deletions

View File

@@ -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'] ?? '';

View File

@@ -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']];