From eb2d7b1f4f26ad240f823ab7684c86ee7d3d29d1 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 26 Sep 2024 12:14:00 -0700 Subject: [PATCH] Move comment location --- app/Http/Controllers/Api/NotesController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/NotesController.php b/app/Http/Controllers/Api/NotesController.php index 1206445c37..55ec5a3623 100644 --- a/app/Http/Controllers/Api/NotesController.php +++ b/app/Http/Controllers/Api/NotesController.php @@ -22,10 +22,10 @@ class NotesController extends Controller ], ]); - $item = Asset::findOrFail($request->input("id")); - $this->authorize('update', $item); // This can be made dynamic by using $request->input('type') to determine which model type to add the note to. // For now, we are only placing this on Assets + $item = Asset::findOrFail($request->input("id")); + $this->authorize('update', $item); event(new NoteAdded($item, Auth::user(), $validated['note']));