FIX: ventas_ids vacios
This commit is contained in:
@ -9,7 +9,7 @@ class Reset extends Command
|
|||||||
{
|
{
|
||||||
protected function configure(): void
|
protected function configure(): void
|
||||||
{
|
{
|
||||||
$this->addOption('venta_ids', 'vid', Console\Input\InputOption::VALUE_OPTIONAL, 'Venta IDs separated by |', '');
|
$this->addOption('venta_ids', 'vid', Console\Input\InputOption::VALUE_REQUIRED, 'Venta IDs separated by |', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output): int
|
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output): int
|
||||||
@ -17,7 +17,11 @@ class Reset extends Command
|
|||||||
$this->logger->debug("Running {$this->getName()}");
|
$this->logger->debug("Running {$this->getName()}");
|
||||||
$uri = '/api/external/toku/reset';
|
$uri = '/api/external/toku/reset';
|
||||||
$output->writeln("DELETE {$uri}");
|
$output->writeln("DELETE {$uri}");
|
||||||
$body = ['venta_ids' => explode('|', $input->getArgument('venta_ids'))];
|
$venta_ids = $input->getOption('venta_ids');
|
||||||
|
$body = [];
|
||||||
|
if (!empty($venta_ids)) {
|
||||||
|
$body = ['venta_ids' => explode('|', $input->getOption('venta_ids'))];
|
||||||
|
}
|
||||||
$options = count($body) > 0 ? ['json' => $body] : [];
|
$options = count($body) > 0 ? ['json' => $body] : [];
|
||||||
$response = $this->client->delete($uri, $options);
|
$response = $this->client->delete($uri, $options);
|
||||||
$output->writeln("Response Code: {$response->getStatusCode()}");
|
$output->writeln("Response Code: {$response->getStatusCode()}");
|
||||||
|
Reference in New Issue
Block a user