mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Pass the model_id variable in the controller and get it only if we are cloning the asset model
This commit is contained in:
parent
a12a68e4e9
commit
4e4ba38038
|
@ -286,6 +286,7 @@ class AssetModelsController extends Controller
|
|||
return view('models/edit')
|
||||
->with('depreciation_list', Helper::depreciationList())
|
||||
->with('item', $model)
|
||||
->with('model_id', $model_to_clone->id)
|
||||
->with('clone_model', $model_to_clone);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,14 +33,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$model_id = $item->id;
|
||||
if (is_null($model_id)){
|
||||
$model_id = $item->getOriginal('id');
|
||||
}
|
||||
@endphp
|
||||
<!-- Custom Fieldset -->
|
||||
@livewire('custom-field-set-default-values-for-model',["model_id" => $model_id])
|
||||
<!-- If $item->id is null we are cloning the model and we need the $model_id variable -->
|
||||
@livewire('custom-field-set-default-values-for-model',["model_id" => ($item->id) ? $item->id : $model_id])
|
||||
|
||||
@include ('partials.forms.edit.notes')
|
||||
@include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/models/general.requestable')])
|
||||
|
|
Loading…
Reference in a new issue