mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 22:07:29 -08:00
Specify created_by in the API call as well
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
bd38d64e66
commit
bc8719e336
|
@ -87,6 +87,7 @@ class AccessoryCheckoutController extends Controller
|
|||
$accessory_checkout->created_by = auth()->id();
|
||||
$accessory_checkout->save();
|
||||
}
|
||||
|
||||
event(new CheckoutableCheckedOut($accessory, $target, auth()->user(), $request->input('note')));
|
||||
|
||||
// Set this as user since we only allow checkout to user for this item type
|
||||
|
|
|
@ -279,14 +279,17 @@ class AccessoriesController extends Controller
|
|||
$accessory->checkout_qty = $request->input('checkout_qty', 1);
|
||||
|
||||
for ($i = 0; $i < $accessory->checkout_qty; $i++) {
|
||||
AccessoryCheckout::create([
|
||||
|
||||
$accessory_checkout = new AccessoryCheckout([
|
||||
'accessory_id' => $accessory->id,
|
||||
'created_at' => Carbon::now(),
|
||||
'created_by' => auth()->id(),
|
||||
'assigned_to' => $target->id,
|
||||
'assigned_type' => $target::class,
|
||||
'note' => $request->input('note'),
|
||||
]);
|
||||
|
||||
$accessory_checkout->created_by = auth()->id();
|
||||
$accessory_checkout->save();
|
||||
}
|
||||
|
||||
// Set this value to be able to pass the qty through to the event
|
||||
|
|
Loading…
Reference in a new issue