Inserve configuration API call does not longer require the obsolete source_name field.
This commit is contained in:
@@ -20,14 +20,15 @@ class API_system_sources extends API
|
||||
source_custom_data,
|
||||
source_create_timestamp,
|
||||
source_modified_timestamp)
|
||||
VALUES (UUID(), ?, ?, '', '', ?, ?, ?, NULL)
|
||||
VALUES (UUID(), 'inserve', ?, '', '', ?, ?, ?, NULL)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
source_url = VALUES(source_url),
|
||||
source_auth_token = VALUES(source_auth_token),
|
||||
source_custom_data = VALUES(source_custom_data),
|
||||
source_modified_timestamp = VALUES(source_create_timestamp)";
|
||||
$stmt = $this->prepareStatement($query);
|
||||
$stmt->bind_param('ssssi', $this->data['source_name'], $this->data['source_url'], $this->data['source_auth_token'], $this->data['source_custom_data'], time());
|
||||
$source_modified_timestamp = time();
|
||||
$stmt->bind_param('sssi', $this->data['source_url'], $this->data['source_auth_token'], $this->data['source_custom_data'], $source_modified_timestamp);
|
||||
$this->executeStatement($stmt);
|
||||
$stmt->close();
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ $pageNavbar->outPutNavbar();
|
||||
<form id="FormValidation" method="post" action="/api/v1/portal-management/sources/inserve/">
|
||||
<input type="hidden" name="_method" value="POST">
|
||||
<input type="hidden" name="_return" value="/portal-management/sources/inserve">
|
||||
<input type="hidden" name="source_name" value="inserve">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group form-show-validation row">
|
||||
|
||||
Reference in New Issue
Block a user