Skip to content

Commit

Permalink
chore: Use EventService in EnrollmentService [DHIS2-18791]
Browse files Browse the repository at this point in the history
  • Loading branch information
enricocolasante committed Jan 16, 2025
1 parent d4f9382 commit 646eceb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ public RelationshipItem getEnrollmentInRelationshipItem(@Nonnull UID uid, boolea
includeDeleted,
currentUser));
} catch (ForbiddenException e) {
return null;
throw new IllegalArgumentException(
"this must be a bug as enrollment ACL was already checked "
+ "and events are not included in the request");
}
return relationshipItem;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,15 @@ private Event getEvent(
return event;
}

@Nonnull
@Override
public List<Event> getEvents(@Nonnull EventOperationParams operationParams)
throws BadRequestException, ForbiddenException {
EventQueryParams queryParams = paramsMapper.map(operationParams, getCurrentUserDetails());
return eventStore.getEvents(queryParams);
}

@Nonnull
@Override
public Page<Event> getEvents(
@Nonnull EventOperationParams operationParams, @Nonnull PageParams pageParams)
Expand Down

0 comments on commit 646eceb

Please sign in to comment.