Inserve configuration API call does not longer require the obsolete source_name field.
This commit is contained in:
@@ -11,21 +11,14 @@ if ($API_system_sources->request_method === 'POST') {
|
||||
# Enable or disable a module
|
||||
$API_system_sources->checkPermissions('admin-sources', 'RW');
|
||||
|
||||
if ($_POST['source_name'] == 'inserve') {
|
||||
$requiredFields = [
|
||||
'source_name' => ['type' => 'string'],
|
||||
'source_url' => ['type' => 'string'],
|
||||
'source_auth_token' => ['type' => 'string'],
|
||||
'source_custom_data' => ['type' => 'json'],
|
||||
];
|
||||
} else {
|
||||
$API_system_sources->apiOutput(400, ['error' => 'Error: no valid source_name posted']);
|
||||
}
|
||||
$requiredFields = [
|
||||
'source_url' => ['type' => 'string'],
|
||||
'source_auth_token' => ['type' => 'string'],
|
||||
'source_custom_data' => ['type' => 'json'],
|
||||
];
|
||||
|
||||
$API_system_sources->validateData($requiredFields);
|
||||
|
||||
if ($_POST['source_name'] == 'inserve') {
|
||||
$API_system_sources->inserveUpdate();
|
||||
}
|
||||
$API_system_sources->inserveUpdate();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user