Fire event when accessory checked out via API

Brings behavior in line with GUI controller
This commit is contained in:
Marcus Moore 2024-01-29 17:03:19 -08:00
parent a2cba67f4e
commit 42ec2548c9
No known key found for this signature in database

View file

@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
use App\Events\CheckoutableCheckedOut;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\AccessoriesTransformer;
@ -302,7 +303,7 @@ class AccessoriesController extends Controller
'note' => $request->get('note'),
]);
$accessory->logCheckout($request->input('note'), $user);
event(new CheckoutableCheckedOut($accessory, $user, Auth::user(), $request->input('note')));
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.checkout.success')));
}