VA
"numberOfMouths": null,
"shakingModel": null,
"productType": "A",
"registrationType": "V",
"tankCapacity": null,
"active": true,
"createdAt": "2020-02-27T15:35:32.931Z",
"updatedAt": "2020-02-27T15:35:32.931Z",
"idPlaque": 1
},
{
"plaque": "LSJ0023",
"description": "Arraial dos Lucas",
"numberOfMouths": null,
"shakingModel": null,
"productType": "A",
"registrationType": "T",
"tankCapacity": null,
"active": true,
"createdAt": "2020-02-27T15:45:00.042Z",
"updatedAt": "2020-02-27T15:45:00.042Z",
"idPlaque": 2
}
]
}
And if I pass skip 0 and take 2 return the both registers normally. Ok.. But I have filters and searchs in this. I can search by the plaque by example.. I tried to do with 'create query builder' all works less than pagination.. The code of typeorm is:
const compositions = await createQueryBuilder(Composition, 'composition')
.leftJoinAndSelect('composition.plaques', 'plaques')
.where(`composition.status <> 1 AND ${filterAndSearchOptions.where} ORDER BY ${filterAndSearchOptions.orderBy} ${filterAndSearchOptions.direction}${filterAndSearchOptions.pagination}`,
filterAndSearchOptions.params)
.getMany();
the variable filterAndSearchOptions do the controll of search and filters.. but when I pass skip 0 and take 1 then return only one register with only one plaque.. Because it is a many to many relation..
it returns:
