Rewrite filters to better ui

This commit is contained in:
Tim
2025-05-10 15:48:27 +02:00
parent cda03f7b67
commit a7c94a8f21
3 changed files with 56 additions and 26 deletions

View File

@ -4,18 +4,23 @@ namespace App\Dto;
readonly class SnipFilterRequest implements CachableDtoInterface
{
public const string VISIBILITY_ALL = 'all';
public const string VISIBILITY_VISIBLE = 'visible';
public const string VISIBILITY_HIDDEN = 'hidden';
public const string SORT_NAME = 'name';
public const string SORT_DATE = 'date';
public function __construct(
public bool $onlyVisible = true,
public ?string $visibility = self::VISIBILITY_VISIBLE,
public ?string $sort = self::SORT_DATE,
) {}
public function toArray(): array
{
return [
'onlyVisible' => $this->onlyVisible,
'visibility' => $this->visibility,
'sort' => $this->sort,
];
}
}