Adds condition to only update the Asset's Model Number if is provided by import file

This commit is contained in:
Ivan Nieto Vivanco 2022-01-15 04:15:38 -06:00
parent 8bd280b416
commit 58b1db29e2

View file

@ -210,6 +210,11 @@ class ItemImporter extends Importer
$this->log('Matching Model found, updating it.');
$item = $this->sanitizeItemForStoring($asset_model, $editingModel);
$item['name'] = $asset_model_name;
if(!empty($asset_modelNumber)){
$item['model_number'] = $asset_modelNumber;
}
$asset_model->update($item);
$asset_model->save();
$this->log('Asset Model Updated');