aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJana Peper <jana.peper@nextcloud.com>2024-12-11 18:18:54 +0100
committerjanepie <49834966+janepie@users.noreply.github.com>2024-12-18 18:32:34 +0100
commit8042a82c64e6e73467f0f943fdadde97c837edc3 (patch)
tree500f2262e2b276551a00c3a30814f72b431e4edf /core
parent79023b9f3ec18cf72003822c1e837bc97ae0788a (diff)
downloadnextcloud-server-8042a82c64e6e73467f0f943fdadde97c837edc3.tar.gz
nextcloud-server-8042a82c64e6e73467f0f943fdadde97c837edc3.zip
feat: add occ command for task type toggling
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
Diffstat (limited to 'core')
-rw-r--r--core/Command/TaskProcessing/EnabledCommand.php10
1 files changed, 3 insertions, 7 deletions
diff --git a/core/Command/TaskProcessing/EnabledCommand.php b/core/Command/TaskProcessing/EnabledCommand.php
index c25251d61c4..44a5cdef256 100644
--- a/core/Command/TaskProcessing/EnabledCommand.php
+++ b/core/Command/TaskProcessing/EnabledCommand.php
@@ -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);