update sometimes
This commit is contained in:
@@ -38,10 +38,14 @@ class OsVersion extends Controller
|
||||
}
|
||||
public function store(OsVersionRequest $request)
|
||||
{
|
||||
$request->validated();
|
||||
$validatedData = $request->validated();
|
||||
|
||||
// Remove unnecessary fields
|
||||
unset($validatedData['vcenter_id'], $validatedData['module_datacenter_id']);
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$this->osRepository->create($request->all());
|
||||
$this->osRepository->create($validatedData);
|
||||
DB::commit();
|
||||
} catch (\Exception $error) {
|
||||
DB::rollBack();
|
||||
@@ -69,9 +73,15 @@ class OsVersion extends Controller
|
||||
if (! $version) {
|
||||
return back()->withErrors('Can\'t find version os by ID #' . $id);
|
||||
}
|
||||
|
||||
$validatedData = $request->validated();
|
||||
|
||||
// Remove unnecessary fields
|
||||
unset($validatedData['vcenter_id'], $validatedData['module_datacenter_id']);
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$this->osRepository->update($id,$request->all());
|
||||
$this->osRepository->update($id, $validatedData);
|
||||
DB::commit();
|
||||
} catch (\Exception $error) {
|
||||
DB::rollBack();
|
||||
|
||||
Reference in New Issue
Block a user