fix: adds 'view all ...' button to dashboard widgets
This commit is contained in:
@@ -15,6 +15,8 @@ final class DownloadList extends AbstractController
|
||||
|
||||
public string $type;
|
||||
|
||||
public bool $isWidget = true;
|
||||
|
||||
public function __construct(
|
||||
private readonly DownloadRepository $downloadRepository,
|
||||
) {}
|
||||
|
||||
@@ -4,17 +4,22 @@ namespace App\Twig\Components;
|
||||
|
||||
use App\Monitor\Framework\Repository\MonitorRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\UX\LiveComponent\Attribute\LiveAction;
|
||||
use Symfony\UX\LiveComponent\Attribute\LiveArg;
|
||||
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;
|
||||
|
||||
#[AsTwigComponent]
|
||||
final class MonitorList extends AbstractController
|
||||
{
|
||||
public bool $isWidget = true;
|
||||
|
||||
public function __construct(
|
||||
private MonitorRepository $monitorRepository,
|
||||
private readonly MonitorRepository $monitorRepository,
|
||||
) {}
|
||||
|
||||
public function getUserMonitors()
|
||||
#[LiveAction]
|
||||
public function getUserMonitors(#[LiveArg] int $page = 1, #[LiveArg] int $perPage = 5)
|
||||
{
|
||||
return $this->getUser()->getMonitors();
|
||||
return $this->monitorRepository->getUserMonitorsPaginated($this->getUser(), $page, $perPage);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user