From cd7db5c4a8448239b632507ea53a25545b41d972 Mon Sep 17 00:00:00 2001 From: r-xyz <100710244+r-xyz@users.noreply.github.com> Date: Wed, 21 Aug 2024 22:24:08 +0200 Subject: [PATCH] Fix some typos in models file handler. --- app/Http/Controllers/Api/AssetModelFilesController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Api/AssetModelFilesController.php b/app/Http/Controllers/Api/AssetModelFilesController.php index 9d17de4aec..90d283f72e 100644 --- a/app/Http/Controllers/Api/AssetModelFilesController.php +++ b/app/Http/Controllers/Api/AssetModelFilesController.php @@ -42,7 +42,7 @@ class AssetModelFilesController extends Controller } // Make sure we are allowed to update this asset - $this->authorize('update', $asset); + $this->authorize('update', $assetModel); if ($request->hasFile('file')) { // If the file storage directory doesn't exist; create it @@ -52,13 +52,13 @@ class AssetModelFilesController extends Controller // Loop over the attached files and add them to the asset foreach ($request->file('file') as $file) { - $file_name = $request->handleFile('private_uploads/assetmodels/','model-'.$asset->id, $file); + $file_name = $request->handleFile('private_uploads/assetmodels/','model-'.$assetModel->id, $file); - $asset->logUpload($file_name, e($request->get('notes'))); + $assetModel->logUpload($file_name, e($request->get('notes'))); } // All done - report success - return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/models/message.upload.success'))); + return response()->json(Helper::formatStandardApiResponse('success', $assetModel, trans('admin/models/message.upload.success'))); } // We only reach here if no files were included in the POST, so tell the user this