Skip to content

Commit

Permalink
feat: add desc time sort
Browse files Browse the repository at this point in the history
  • Loading branch information
xchopin committed Feb 6, 2020
1 parent 5fe922e commit a243920
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public Collection<Event> findAll(final String tenantId, final String orgId, Stri
* @throws EventNotFoundException
*/
public Collection<Event> findByEdApp(final String tenantId, final String orgId, final String page, final String limit, final String edAppId) throws EventNotFoundException {
Pageable pageRequest = PageRequest.of(Integer.parseInt(page), Integer.parseInt(limit), Sort.by("event.eventTime"));
Pageable pageRequest = PageRequest.of(Integer.parseInt(page), Integer.parseInt(limit), Sort.by("event.eventTime").descending());

Collection<MongoEvent> mongoEvents = mongoEventRepository.findTopByTenantIdAndOrganizationIdAndEventEdAppIdOrderByEventEventTimeDesc(tenantId, orgId, edAppId, pageRequest);
if (mongoEvents != null && !mongoEvents.isEmpty()) {
Expand Down

0 comments on commit a243920

Please sign in to comment.