mirror of
https://github.com/chenasraf/nextcloud-autocurrency.git
synced 2026-05-18 01:29:05 +00:00
fix(ApiController): use argument param in updateSettings
This commit is contained in:
@@ -104,14 +104,15 @@ class ApiController extends OCSController {
|
||||
/**
|
||||
* Update auto currency settings
|
||||
*
|
||||
* @param array{interval: int} $data Data to update
|
||||
* @return DataResponse<Http::STATUS_OK, array{status:non-empty-string}, array{}>
|
||||
*
|
||||
* 200: Data returned
|
||||
*/
|
||||
// #[NoAdminRequired]
|
||||
#[ApiRoute(verb: 'PUT', url: '/api/cron')]
|
||||
public function updateSettings(): DataResponse {
|
||||
$interval = $this->request->getParam('data')['interval'];
|
||||
public function updateSettings(mixed $data): DataResponse {
|
||||
$interval = $data['interval'];
|
||||
$this->config->setValueInt(AppInfo\Application::APP_ID, 'cron_interval', $interval);
|
||||
return new DataResponse(
|
||||
['status' => 'OK']
|
||||
|
||||
28
openapi.json
28
openapi.json
@@ -158,6 +158,34 @@
|
||||
"basic_auth": []
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"data"
|
||||
],
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "object",
|
||||
"description": "Data to update",
|
||||
"required": [
|
||||
"interval"
|
||||
],
|
||||
"properties": {
|
||||
"interval": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "OCS-APIRequest",
|
||||
|
||||
Reference in New Issue
Block a user