Skip to content

Commit

Permalink
feat: add occ command for task type toggling
Browse files Browse the repository at this point in the history
Signed-off-by: Jana Peper <[email protected]>
  • Loading branch information
janepie committed Dec 12, 2024
1 parent b0016d6 commit 608fee3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions core/Command/TaskProcessing/EnabledCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(

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',
Expand All @@ -44,14 +44,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
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;

$taskTypeSettings[$taskType] = $enabled;


$this->config->setAppValue('core', 'ai.taskprocessing_type_preferences', json_encode($taskTypeSettings));
$this->writeArrayInOutputFormat($input, $output, $taskTypeSettings);
Expand Down

0 comments on commit 608fee3

Please sign in to comment.