mirror of
https://github.com/flextype/flextype.git
synced 2025-08-07 05:36:54 +02:00
feat(console): update EntriesCreateCommand #543
This commit is contained in:
@@ -29,10 +29,10 @@ class EntriesCreateCommand extends Command
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
$data = serializers()->json()->decode($input->getOption('data') ?? []);
|
||||
$data = $input->getOption('data') ? serializers()->json()->decode($input->getOption('data')) : [];
|
||||
|
||||
if (entries()->create($input->getOption('id'), $data)) {
|
||||
$io->success('Created entry ' . $input->getOption('id'));
|
||||
$io->success('Entry ' . $input->getOption('id') . ' created.');
|
||||
return Command::SUCCESS;
|
||||
} else {
|
||||
$io->error('Entry ' . $input->getOption('id') . ' wasn\'t created.');
|
||||
|
Reference in New Issue
Block a user