chore(api): show online devices first

This commit is contained in:
leandrofars 2024-01-11 19:19:35 -03:00
parent 8f226d09a9
commit 5fd6afc8fa

View File

@ -109,9 +109,12 @@ func (a *Api) retrieveDevices(w http.ResponseWriter, r *http.Request) {
//TODO: Create filters
//TODO: Create sorting
sort := bson.M{}
sort["status"] = 1
filter := bson.A{
//bson.M{"$match": filter},
//bson.M{"$sort": sort},
bson.M{"$sort": sort}, // shows online devices first
bson.M{"$skip": skip},
bson.M{"$limit": page_size},
}