diff --git a/VERSION b/VERSION index 373aea9..79f82f6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.57.0 +1.58.0 diff --git a/backend/app/Http/Controllers/Api/AssetAccountController.php b/backend/app/Http/Controllers/Api/AssetAccountController.php index 624c827..7d83cc6 100644 --- a/backend/app/Http/Controllers/Api/AssetAccountController.php +++ b/backend/app/Http/Controllers/Api/AssetAccountController.php @@ -283,7 +283,10 @@ public function storeWithWizard(Request $request): JsonResponse // Criar o ativo $data = $validator->validated(); $data['user_id'] = Auth::id(); - $data['business_id'] = $request->business_id ?? Auth::user()->businesses()->first()?->id; + // business_id é opcional e vem do request se fornecido + if ($request->filled('business_id')) { + $data['business_id'] = $request->business_id; + } $data['status'] = 'active'; $asset = AssetAccount::create($data);