mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Add an early return if the model id is not set (for new Asset Models)
This commit is contained in:
parent
a26119c262
commit
7383ec7f1e
|
@ -17,6 +17,10 @@ class CustomFieldSetDefaultValuesForModel extends Component
|
|||
|
||||
public function mount()
|
||||
{
|
||||
if(is_null($this->model_id)){
|
||||
return;
|
||||
}
|
||||
|
||||
$this->model = AssetModel::find($this->model_id); // It's possible to do some clever route-model binding here, but let's keep it simple, shall we?
|
||||
$this->fieldset_id = $this->model->fieldset_id;
|
||||
|
||||
|
|
|
@ -34,9 +34,7 @@
|
|||
</div>
|
||||
|
||||
<!-- Custom Fieldset -->
|
||||
@if (isset($item->id))
|
||||
@livewire('custom-field-set-default-values-for-model',["model_id" => $item->id])
|
||||
@endif
|
||||
@livewire('custom-field-set-default-values-for-model',["model_id" => $item->id])
|
||||
|
||||
@include ('partials.forms.edit.notes')
|
||||
@include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/models/general.requestable')])
|
||||
|
|
Loading…
Reference in a new issue