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 8c7d0f9 commit d2ff0bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 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,11 +44,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if ($json === '') {
$taskTypeSettings = [];
} else {
$taskTypeSettings = json_decode($json, true);
$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 d2ff0bb

Please sign in to comment.