cleanup + notes for monday

This commit is contained in:
spencerrlongg 2024-04-04 18:23:03 -05:00
parent 52340aca78
commit 997eddfed1
2 changed files with 4 additions and 3 deletions

View file

@ -38,8 +38,6 @@ class StoreAssetRequest extends ImageUploadRequest
'company_id' => $idForCurrentUser,
'assigned_to' => $assigned_to ?? null,
]);
//$this->after();
}
/**

View file

@ -15,6 +15,7 @@ trait MayContainCustomFields
});
if (count($request_fields) > 0) {
if ($this->method() == 'POST') {
// refactor to eager load the fields???
$request_fields->diff(AssetModel::find($this->model_id)->fieldset->fields->pluck('db_column'))
->each(function ($request_field_name) use ($request_fields, $validator) {
// i could probably add some more conditions here to determine whether or not the column exists but just not on this asset model
@ -23,9 +24,11 @@ trait MayContainCustomFields
});
} elseif ($this->method() == 'PUT' || $this->method() == 'PATCH') {
// need to know about other pr before I can go down this route
// it should be more or less the same, just have to get the asset model differently
// ($this->asset should work if the other PR is accepted)
return;
}
}
});
}
}