resolved, missed adding errors in a case

This commit is contained in:
slong753 2023-06-28 16:45:18 -05:00
parent 8923206ac8
commit afe6fe207a

View file

@ -219,15 +219,15 @@ class BulkAssetsController extends Controller
foreach ($assetCustomFields?->fields as $field) { foreach ($assetCustomFields?->fields as $field) {
if (array_key_exists($field->db_column, $this->update_array)) { if (array_key_exists($field->db_column, $this->update_array)) {
$asset->{$field->db_column} = $this->update_array[$field->db_column]; $asset->{$field->db_column} = $this->update_array[$field->db_column];
$asset->save(); $saved = $asset->save();
if(!$saved) {
$error_bag[] = $asset->getErrors();
}
continue; continue;
} else { } else {
$array = $this->update_array; $array = $this->update_array;
array_except($array, $field->db_column); array_except($array, $field->db_column);
// $asset->update($array);
$asset->save($array); $asset->save($array);
//call update on parent model
// $asset->save();
} }
if (!$asset->save()) { if (!$asset->save()) {
$error_bag[] = $asset->getErrors(); $error_bag[] = $asset->getErrors();