1
0
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:
Awilum
2021-09-14 18:33:39 +03:00
parent 38dd8f2f44
commit 278793ab8f

View File

@@ -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.');