count instances to type
This commit is contained in:
parent
705297ba50
commit
c42a41d895
12 changed files with 24 additions and 3 deletions
|
@ -19,7 +19,10 @@ export default abstract class VehicleTypeService {
|
|||
search?: string;
|
||||
noLimit?: boolean;
|
||||
}): Promise<[Array<vehicleType>, number]> {
|
||||
let query = dataSource.getRepository(vehicleType).createQueryBuilder("vehicleType");
|
||||
let query = dataSource
|
||||
.getRepository(vehicleType)
|
||||
.createQueryBuilder("vehicleType")
|
||||
.loadRelationCountAndMap("vehicleType.vehicleCount", "vehicleType.vehicle");
|
||||
|
||||
if (search != "") {
|
||||
query = query.where({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue