-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Need to return specific fields in a search function and we were unable to use a .map or build a query.
Search functions only have a filter option. The idea was to use this field to be more robust so that it starts to receive more parameters.
Today
async findBy(condition: Filter<T> | ((qb: Knex.QueryBuilder<T>) => unknown)) {
return this.select().where(condition) as Promise<T[]>;
}
To
async findBy(option: Filter<T> | ((qb: Knex.QueryBuilder<T>) => unknown)) {
return this.select(option.select).where(option.where) as Promise<T[]>;
}
If there are parameter implementations it could help.
Metadata
Metadata
Assignees
Labels
No labels