Public Access
feat(database): return newest journeys first
This commit is contained in:
@@ -236,7 +236,12 @@ class Journey {
|
|||||||
static Future<List<Journey>> dbGetAll({int num = 40, int offset = 0}) async {
|
static Future<List<Journey>> dbGetAll({int num = 40, int offset = 0}) async {
|
||||||
//final batch = DbHelper.db.batch; // later
|
//final batch = DbHelper.db.batch; // later
|
||||||
Database database = DbHelper.db;
|
Database database = DbHelper.db;
|
||||||
var tmp = await database.query(tableName, limit: num, offset: offset);
|
var tmp = await database.query(
|
||||||
|
tableName,
|
||||||
|
limit: num,
|
||||||
|
offset: offset,
|
||||||
|
orderBy: 'id DESC',
|
||||||
|
);
|
||||||
Future<List<Journey>> journeys = Future.wait(
|
Future<List<Journey>> journeys = Future.wait(
|
||||||
tmp.map((jour) => fromMapWrapper(jour)),
|
tmp.map((jour) => fromMapWrapper(jour)),
|
||||||
);
|
);
|
||||||
@@ -1178,4 +1183,4 @@ enum VehicleType {
|
|||||||
subway,
|
subway,
|
||||||
regionalTrain,
|
regionalTrain,
|
||||||
PLACEHOLDER,
|
PLACEHOLDER,
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user