Skip to content

Commit

Permalink
perf: improve template fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
scopsy authored and Joel Anton committed May 9, 2024
1 parent 20b3a19 commit 4ace5bb
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ export class NotificationTemplateRepository extends BaseRepository<
active: active,
};

const items = await this.MongooseModel.find(requestQuery).populate('notificationGroup').read('secondaryPreferred');
const items = await this.MongooseModel.find(requestQuery)
.populate('steps.template', { type: 1 })
.populate('notificationGroup')
.read('secondaryPreferred');

return this.mapEntities(items);
}
Expand Down

0 comments on commit 4ace5bb

Please sign in to comment.