-
-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
list.json cannot take multiple filters #1487
Comments
this is implemented in
|
My thought is to refactor that to use a QueryBuilder. Or do you have another suggestion? |
Since this is running on Symfony 7, is there any reason not to take advantage of the cool features later Symfony versions offer, e.g. public function listAction(Request $req,
#[MapQueryParameter] ?string $type=null,
#[MapQueryParameter] ?string $vendor=null
): JsonResponse |
@tacman I don't see how this is relevant to this issue about supporting to combine filters instead of applying them separately. |
What do you think about combining this into a single method getPackageNamesByVendorAndType()? if ($req->query->get('type')) {
$names = $repo->getPackageNamesByType($req->query->get('type'));
} elseif ($req->query->get('vendor')) {
$names = $repo->getPackageNamesByVendor($req->query->get('vendor')); to if ($type || $vendor ) {
$names = $repo->getPackageNamesByVendorAndType($vendor, $type);
} The above looks cleaner to me, thus the MapQueryParameter |
listing by vendor or type works as expected:
But combining the filters doesn't:
I might be able to submit a PR if someone can point me to the file where this happens.
The text was updated successfully, but these errors were encountered: