|
@@ -6,6 +6,7 @@
|
|
|
use App\Http\Requests\FinancialPlanAccountRequest;
|
|
use App\Http\Requests\FinancialPlanAccountRequest;
|
|
|
use App\Http\Resources\FinancialPlanAccountResource;
|
|
use App\Http\Resources\FinancialPlanAccountResource;
|
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
|
+use Illuminate\Http\Request;
|
|
|
|
|
|
|
|
class FinancialPlanAccountController extends Controller
|
|
class FinancialPlanAccountController extends Controller
|
|
|
{
|
|
{
|
|
@@ -13,9 +14,10 @@ public function __construct(
|
|
|
protected FinancialPlanAccountService $service,
|
|
protected FinancialPlanAccountService $service,
|
|
|
) {}
|
|
) {}
|
|
|
|
|
|
|
|
- public function index(): JsonResponse
|
|
|
|
|
|
|
+ public function index(Request $request): JsonResponse
|
|
|
{
|
|
{
|
|
|
- $items = $this->service->getAll();
|
|
|
|
|
|
|
+ $unitId = $request->filled('unit_id') ? (int) $request->input('unit_id') : null;
|
|
|
|
|
+ $items = $this->service->getAll($unitId);
|
|
|
return $this->successResponse(payload: FinancialPlanAccountResource::collection($items));
|
|
return $this->successResponse(payload: FinancialPlanAccountResource::collection($items));
|
|
|
}
|
|
}
|
|
|
|
|
|