Skip to content

Commit

Permalink
fix(performance): avoid slow query for relations when loading children (
Browse files Browse the repository at this point in the history
  • Loading branch information
sleidig authored Apr 11, 2023
1 parent 07b315b commit de87405
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/child-dev-project/children/children.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class ChildrenService {
*/
async getChildren(): Promise<Child[]> {
const children = await this.entityMapper.loadType(Child);
const relations = await this.queryRelations(`${Child.ENTITY_TYPE}:`);
const relations = await this.entityMapper.loadType(ChildSchoolRelation);
groupBy(relations, "childId").forEach(([id, rels]) => {
const child = children.find((c) => c.getId() === id);
if (child) {
Expand Down

0 comments on commit de87405

Please sign in to comment.