[Feature] 13789 apiv2 ids parameter ignored for planning elements

[``* `#13789` Ids parameter ignored in API v2's planning elements endpoint``](https://www.openproject.org/work_packages/13789)
It's good to have that encapsulated into a separate method but doing this makes most sense to use this in order to get rid of the before filter and change the coding to something like:

<pre>
wp_ids = parse_work_package_ids
work_packages = work_packages.where(id: wp_ids) if wp_ids
</pre>

Less magic, and you are only using the functionality for ```index```.

But maybe this is just because I dislike before filters nowadays and try to avoid them if possible at all.