oha
This commit is contained in:
parent
b4ae1f9007
commit
51fb951b2b
2 changed files with 24 additions and 4 deletions
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||
namespace App\Controller;
|
||||
|
||||
use App\Repository\DrinkTypeRepository;
|
||||
use App\Service\DrinkType\FilterLowStockDrinks;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
@ -12,10 +13,15 @@ use Symfony\Component\Routing\Attribute\Route;
|
|||
#[Route(path: '/', name: 'app_index')]
|
||||
final class Index extends AbstractController
|
||||
{
|
||||
public function __invoke(DrinkTypeRepository $drinkTypeRepository): Response
|
||||
{
|
||||
public function __invoke(
|
||||
DrinkTypeRepository $drinkTypeRepository,
|
||||
FilterLowStockDrinks $filterLowStockDrinks
|
||||
): Response {
|
||||
$wanted = $drinkTypeRepository->findWanted();
|
||||
$lowStock = $filterLowStockDrinks($wanted);
|
||||
return $this->render('index.html.twig', [
|
||||
'drinkTypes' => $drinkTypeRepository->findWanted(),
|
||||
'drinkTypes' => $lowStock,
|
||||
'lowStock' => $lowStock,
|
||||
]);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue