mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 16:44:44 +02:00
Fix this
This commit is contained in:
parent
3a95105931
commit
c4c4834acc
@ -26,19 +26,13 @@ class EggCreationService
|
|||||||
{
|
{
|
||||||
$data['config_from'] = array_get($data, 'config_from');
|
$data['config_from'] = array_get($data, 'config_from');
|
||||||
if (!is_null($data['config_from'])) {
|
if (!is_null($data['config_from'])) {
|
||||||
$results = Egg::query()
|
$parentEgg = Egg::query()->find(array_get($data, 'config_from'));
|
||||||
->where('nest_id', array_get($data, 'nest_id'))
|
throw_unless($parentEgg, new NoParentConfigurationFoundException(trans('exceptions.egg.invalid_copy_id')));
|
||||||
->where('id', array_get($data, 'config_from'))
|
|
||||||
->count();
|
|
||||||
|
|
||||||
if ($results !== 1) {
|
|
||||||
throw new NoParentConfigurationFoundException(trans('exceptions.egg.invalid_copy_id'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Egg::query()->create(array_merge($data, [
|
return Egg::query()->create(array_merge($data, [
|
||||||
'uuid' => Uuid::uuid4()->toString(),
|
'uuid' => Uuid::uuid4()->toString(),
|
||||||
'author' => $this->config->get('pterodactyl.service.author'),
|
'author' => $this->config->get('panel.service.author'),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user