Fix some data integrity issues
This commit is contained in:
parent
d52f8d9215
commit
241f7d0125
6 changed files with 41 additions and 37 deletions
|
@ -44,10 +44,15 @@ class VariableCreationService
|
|||
|
||||
$options = array_get($data, 'options') ?? [];
|
||||
|
||||
return $this->repository->create(array_merge($data, [
|
||||
return $this->repository->create([
|
||||
'egg_id' => $egg,
|
||||
'name' => $data['name'] ?? '',
|
||||
'description' => $data['description'] ?? '',
|
||||
'env_variable' => $data['env_variable'] ?? '',
|
||||
'default_value' => $data['default_value'] ?? '',
|
||||
'user_viewable' => in_array('user_viewable', $options),
|
||||
'user_editable' => in_array('user_editable', $options),
|
||||
]));
|
||||
'rules' => $data['rules'] ?? '',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue