Sort transactions in reverse chronological order
This commit is contained in:
parent
8ec81622e7
commit
620b1cb09a
1 changed files with 2 additions and 2 deletions
|
@ -13,9 +13,9 @@ export class TransactionService {
|
||||||
|
|
||||||
getTransactions(count?: number): Observable<Transaction[]> {
|
getTransactions(count?: number): Observable<Transaction[]> {
|
||||||
if (count) {
|
if (count) {
|
||||||
return from(this.db.transactions.toCollection().limit(count).toArray())
|
return from(this.db.transactions.orderBy('date').reverse().limit(count).toArray())
|
||||||
} else {
|
} else {
|
||||||
return from(this.db.transactions.toCollection().toArray())
|
return from(this.db.transactions.orderBy('date').reverse().toArray())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue