Sort transactions in reverse chronological order

This commit is contained in:
William Brawner 2018-09-02 21:51:25 -05:00
parent 8ec81622e7
commit 620b1cb09a

View file

@ -13,9 +13,9 @@ export class TransactionService {
getTransactions(count?: number): Observable<Transaction[]> {
if (count) {
return from(this.db.transactions.toCollection().limit(count).toArray())
return from(this.db.transactions.orderBy('date').reverse().limit(count).toArray())
} else {
return from(this.db.transactions.toCollection().toArray())
return from(this.db.transactions.orderBy('date').reverse().toArray())
}
}