Parametros faltantes
This commit is contained in:
@ -7,12 +7,19 @@ use Incoviba\Common\Alias\Command;
|
||||
#[Console\Attribute\AsCommand(name: 'external:toku:reset')]
|
||||
class Reset extends Command
|
||||
{
|
||||
protected function configure(): void
|
||||
{
|
||||
$this->addOption('venta_ids', 'vid', Console\Input\InputOption::VALUE_OPTIONAL, 'Venta IDs separated by |', '');
|
||||
}
|
||||
|
||||
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output): int
|
||||
{
|
||||
$this->logger->debug("Running {$this->getName()}");
|
||||
$uri = '/api/external/toku/reset';
|
||||
$output->writeln("GET {$uri}");
|
||||
$response = $this->client->get($uri);
|
||||
$output->writeln("DELETE {$uri}");
|
||||
$body = ['venta_ids' => explode('|', $input->getArgument('venta_ids'))];
|
||||
$options = count($body) > 0 ? ['json' => $body] : [];
|
||||
$response = $this->client->delete($uri, $options);
|
||||
$output->writeln("Response Code: {$response->getStatusCode()}");
|
||||
|
||||
return self::SUCCESS;
|
||||
|
Reference in New Issue
Block a user