feat(transactions): add pagination support for user transactions
Some checks failed
Some checks failed
This commit is contained in:
parent
157e774e86
commit
35184807c0
11 changed files with 47 additions and 24 deletions
|
@ -4,6 +4,7 @@ import { Observable } from 'rxjs';
|
|||
import { Transaction } from '../../model/Transaction';
|
||||
import { AsyncPipe, CurrencyPipe, DatePipe, NgForOf, NgIf } from '@angular/common';
|
||||
import { AnimatedNumberComponent } from '@blackjack/components/animated-number/animated-number.component';
|
||||
import { TransactionData } from '../../model/TransactionData';
|
||||
|
||||
const PER_PAGE = 5
|
||||
|
||||
|
@ -31,7 +32,7 @@ export class TransactionHistoryComponent {
|
|||
protected offset: number = 0;
|
||||
|
||||
private transactionService: TransactionService = inject(TransactionService);
|
||||
transactions$: Observable<Transaction[]> = this.loadTransactions();
|
||||
transactionData$: Observable<TransactionData> = this.loadTransactions();
|
||||
|
||||
closeDialog() {
|
||||
this.isOpen = false;
|
||||
|
@ -40,12 +41,12 @@ export class TransactionHistoryComponent {
|
|||
|
||||
forward() {
|
||||
this.offset++;
|
||||
this.transactions$ = this.loadTransactions();
|
||||
this.transactionData$ = this.loadTransactions();
|
||||
}
|
||||
|
||||
back() {
|
||||
this.offset--;
|
||||
this.transactions$ = this.loadTransactions();
|
||||
this.transactionData$ = this.loadTransactions();
|
||||
}
|
||||
|
||||
loadTransactions() {
|
||||
|
|
Reference in a new issue