Fix server description nullablility

This commit is contained in:
Dane Everitt 2018-01-06 12:58:30 -06:00
parent a75b15cd8d
commit adcab5969a
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 6 additions and 2 deletions

View file

@ -254,6 +254,7 @@ class ServersController extends Controller
* @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\DisplayException
* @throws \Pterodactyl\Exceptions\Model\DataValidationException * @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
* @throws \Illuminate\Validation\ValidationException
*/ */
public function store(ServerFormRequest $request) public function store(ServerFormRequest $request)
{ {

View file

@ -21,7 +21,10 @@ class ServerFormRequest extends AdminFormRequest
*/ */
public function rules() public function rules()
{ {
return Server::getCreateRules(); $rules = Server::getCreateRules();
$rules['description'][] = 'nullable';
return $rules;
} }
/** /**

View file

@ -118,7 +118,7 @@ class ServerCreationService
'uuidShort' => str_random(8), 'uuidShort' => str_random(8),
'node_id' => array_get($data, 'node_id'), 'node_id' => array_get($data, 'node_id'),
'name' => array_get($data, 'name'), 'name' => array_get($data, 'name'),
'description' => array_get($data, 'description', ''), 'description' => array_get($data, 'description') ?? '',
'skip_scripts' => isset($data['skip_scripts']), 'skip_scripts' => isset($data['skip_scripts']),
'suspended' => false, 'suspended' => false,
'owner_id' => array_get($data, 'owner_id'), 'owner_id' => array_get($data, 'owner_id'),