mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
feat: add occ command for task type toggling
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
This commit is contained in:
parent
79023b9f3e
commit
8042a82c64
1 changed files with 3 additions and 7 deletions
|
|
@ -22,7 +22,7 @@ class EnabledCommand extends Base {
|
|||
|
||||
protected function configure() {
|
||||
$this
|
||||
->setName('taskprocessing:task:set-enabled')
|
||||
->setName('taskprocessing:task-type:set-enabled')
|
||||
->setDescription('Enable or disable a task type')
|
||||
->addArgument(
|
||||
'task-type-id',
|
||||
|
|
@ -44,14 +44,10 @@ class EnabledCommand extends Base {
|
|||
if ($json === '') {
|
||||
$taskTypeSettings = [];
|
||||
} else {
|
||||
$taskTypeSettings = json_decode($json, true);
|
||||
}
|
||||
if ($enabled) {
|
||||
$taskTypeSettings[$taskType] = true;
|
||||
} else {
|
||||
$taskTypeSettings[$taskType] = false;
|
||||
$taskTypeSettings = json_decode($json, true, flags: JSON_THROW_ON_ERROR);
|
||||
}
|
||||
|
||||
$taskTypeSettings[$taskType] = $enabled;
|
||||
|
||||
$this->config->setAppValue('core', 'ai.taskprocessing_type_preferences', json_encode($taskTypeSettings));
|
||||
$this->writeArrayInOutputFormat($input, $output, $taskTypeSettings);
|
||||
|
|
|
|||
Loading…
Reference in a new issue