RoleService findAll list display/pagination is broken due to post query filtering
Opened this issue · 0 comments
mschipperheyn commented
Describe the bug
The RoleService findAll query does a post result filter that filters the available roles based on the ability of the current user to see them.
To Reproduce
Steps to reproduce the behavior:
- Create a user and some roles.
- Assign only those roles to the user
- Login as the user
- use take: 1 and sort by createdAt Asc
- The roles you are supposed to see are not on page 1, which is empty
Expected behavior
There are two corrections possible:
- the filtering should happen at the query level instead of at the post query level
- keep the post query filtering but reduce the totalItems by the amount of roles that are "hidden" (this is a bad workaround bc it will still lead to empty screens even though it partly fixes pagination. Solution 1 is the only viable one. )
Environment (please complete the following information):
- @vendure/core version: 2.2.x
- Nodejs version
- Database (mysql/postgres etc): postgres
Additional context
Not using the Vendure admin-ui