Skip to content

Commit

Permalink
fix: eagerly fetch notes
Browse files Browse the repository at this point in the history
  • Loading branch information
teleivo committed Jan 21, 2025
1 parent c69131d commit a300de2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.hisp.dhis.feedback.BadRequestException;
import org.hisp.dhis.feedback.ForbiddenException;
import org.hisp.dhis.feedback.NotFoundException;
import org.hisp.dhis.note.Note;
import org.hisp.dhis.program.Enrollment;
import org.hisp.dhis.program.Event;
import org.hisp.dhis.relationship.RelationshipItem;
Expand Down Expand Up @@ -172,7 +173,11 @@ private Enrollment getEnrollment(
result.setCreatedByUserInfo(enrollment.getCreatedByUserInfo());
result.setLastUpdatedByUserInfo(enrollment.getLastUpdatedByUserInfo());
result.setDeleted(enrollment.isDeleted());
result.setNotes(enrollment.getNotes());
List<Note> notes = new ArrayList<>();
for (Note note : enrollment.getNotes()) {
notes.add(note);
}
result.setNotes(notes);
if (params.isIncludeEvents()) {
result.setEvents(
getEvents(
Expand Down

0 comments on commit a300de2

Please sign in to comment.