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 EquipmentTypeService {
|
|||
search?: string;
|
||||
noLimit?: boolean;
|
||||
}): Promise<[Array<equipmentType>, number]> {
|
||||
let query = dataSource.getRepository(equipmentType).createQueryBuilder("equipmentType");
|
||||
let query = dataSource
|
||||
.getRepository(equipmentType)
|
||||
.createQueryBuilder("equipmentType")
|
||||
.loadRelationCountAndMap("equipmentType.equipmentCount", "equipmentType.equipment");
|
||||
|
||||
if (search != "") {
|
||||
query = query.where({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue