Skip to content

Commit a94613b

Browse files
heiytorotavio
authored andcommitted
fix: standard device list order
1 parent 6542713 commit a94613b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/services/device.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ func (s *service) ListDevices(ctx context.Context, req *requests.DeviceList) ([]
6767
opts = append(opts, s.store.Options().InNamespace(req.TenantID))
6868
}
6969

70+
if req.Sorter.By == "" {
71+
req.Sorter.By = "last_seen"
72+
}
73+
7074
opts = append(opts, s.store.Options().Match(&req.Filters), s.store.Options().Sort(&req.Sorter), s.store.Options().Paginate(&req.Paginator))
7175

7276
if req.DeviceStatus == models.DeviceStatusRemoved {

0 commit comments

Comments
 (0)