Modifiche
This commit is contained in:
@@ -21,6 +21,18 @@ export class BetApiService {
|
||||
private http = inject(HttpClient);
|
||||
private readonly apiUrl = 'http://localhost:3000/api/v1/bets';
|
||||
|
||||
getUserBets(): Observable<Bet[]> {
|
||||
return this.http.get<SuccessResponse<Bet[]>>(`${this.apiUrl}/user`).pipe(
|
||||
map(res => res.data.map(mapBet))
|
||||
);
|
||||
}
|
||||
|
||||
getPublicBets(): Observable<Bet[]> {
|
||||
return this.http.get<SuccessResponse<Bet[]>>(`${this.apiUrl}/public`).pipe(
|
||||
map(res => res.data.map(mapBet))
|
||||
);
|
||||
}
|
||||
|
||||
getBets(): Observable<Bet[]> {
|
||||
return this.http.get<SuccessResponse<Bet[]>>(this.apiUrl).pipe(
|
||||
map(res => res.data.map(mapBet))
|
||||
|
||||
Reference in New Issue
Block a user