import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { History } from '../models/history';

@Injectable({
    providedIn: 'root'
})
export class HistoryService {
    private url = 'https://allowanceplanner.seeseepuff.be/api';

    constructor(private http: HttpClient) {}

    getHistoryList(userId: number): Observable<Array<History>> {
        return this.http.get<History[]>(`${this.url}/user/${userId}/history`);
    }
}