Skip to content

Commit

Permalink
Fix Device Events REST API Sorting
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Mezzasalma <claudio.mezzasalma@eurotech.com>
  • Loading branch information
Claudio Mezzasalma authored and Coduz committed Jul 29, 2021
1 parent bbf6bdf commit 0468e02
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package org.eclipse.kapua.app.api.resources.v1.resources;

import com.google.common.base.Strings;

import org.eclipse.kapua.KapuaEntityNotFoundException;
import org.eclipse.kapua.KapuaException;
import org.eclipse.kapua.app.api.core.resources.AbstractKapuaResource;
Expand Down Expand Up @@ -103,6 +104,9 @@ public DeviceEventListResult simpleQuery(

query.setPredicate(andPredicate);

if (!Strings.isNullOrEmpty(sortParam)) {
query.setSortCriteria(query.fieldSortCriteria(sortParam, sortDir));
}
query.setOffset(offset);
query.setLimit(limit);

Expand Down

0 comments on commit 0468e02

Please sign in to comment.