From f785c3e759e6b7653c07c83bf9ca54fdb06e8efc Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 8 Jul 2021 16:04:52 -0700 Subject: [PATCH] Default to 1 if no qty is passed Signed-off-by: snipe --- app/Http/Controllers/Api/ComponentsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/ComponentsController.php b/app/Http/Controllers/Api/ComponentsController.php index cef8506d7b..d03ee5ea41 100644 --- a/app/Http/Controllers/Api/ComponentsController.php +++ b/app/Http/Controllers/Api/ComponentsController.php @@ -210,7 +210,7 @@ class ComponentsController extends Controller $component->assets()->attach($component->id, [ 'component_id' => $component->id, 'created_at' => \Carbon::now(), - 'assigned_qty' => $request->get('assigned_qty'), + 'assigned_qty' => $request->get('assigned_qty', 1), 'user_id' => \Auth::id(), 'asset_id' => $request->get('assigned_to') ]);