-
Notifications
You must be signed in to change notification settings - Fork 100
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
use select for filter returning result but by default return all result #1025
Comments
Could you explain with code examples what the problem/behaviour is that you want? |
static readonly PAGINATION_CONFIG: PaginateConfig<Project> = {
sortableColumns: ['createdAt'],
searchableColumns: ['name', 'serial'],
nullSort: 'last',
defaultSortBy: [['createdAt', 'DESC']],
relations: [
'a',
'b',
'a.a',
'c',
'c.a',
'c.b',
'd',
'e',
'f',
],
filterableColumns: {},
};
async findAll(query: PaginateQuery) {
return paginate(
query,
this.projectRepository,
Service.PAGINATION_CONFIG,
);
} currently, with the above config, we can get all information we need but in some cases we need to select only some properties. As you can see information we need is too much with relations so I can't specify I want to use a query something like the following /api/projects?page=1&limit=20&select[]=id&select[]=name to only select ID and name, but with the current implementation, we should specify selectable fields in the configuration to able to use select in query params |
This is something you can do with the usage of the |
@Jarzebowsky Yes, you are right but there is a problem, I don't want to send another param to the backend from the frontend to specify this request use a specific group, also I don't want to write another API to use that group When we already have the solution in the package why do we need to define it again using |
Current implementation needs to define select properties to use select in query params
I want to get all available properties but when I need to select some fields use
select
in query params and return selected propertiesI have a big entity with many fields and relations and most of the time I need all results but in some cases like "select inputs" I just need the id and name, I cannot use the select param until I define explicitly select the property in the configuration
The text was updated successfully, but these errors were encountered: