feat(transaction): add transaction retrieval and DTO mapping
This commit is contained in:
parent
5575955440
commit
d6077645d9
13 changed files with 146 additions and 13 deletions
19
frontend/src/app/service/transaction.service.ts
Normal file
19
frontend/src/app/service/transaction.service.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { inject, Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TransactionService {
|
||||
private http: HttpClient = inject(HttpClient);
|
||||
|
||||
public getUsersTransactions(limit: number|null = null) {
|
||||
const baseUrl = '/backend/user/transactions';
|
||||
|
||||
if (limit !== null) {
|
||||
return this.http.get<any[]>(`${baseUrl}?limit=${limit}`);
|
||||
}
|
||||
|
||||
return this.http.get<any[]>(`${baseUrl}`);
|
||||
}
|
||||
}
|
Reference in a new issue