Add allowance service and create get endpoint for allowance

This commit is contained in:
2025-05-24 14:11:44 +02:00
parent f8d1f195de
commit d81ec1f126
8 changed files with 93 additions and 4 deletions

View File

@@ -0,0 +1,17 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Allowance } from '../models/allowance';
@Injectable({
providedIn: 'root'
})
export class AllowanceService {
private url = 'http://localhost:8080/api';
constructor(private http: HttpClient) {}
getAllowanceList(userId: number): Observable<Array<Allowance>> {
return this.http.get<Allowance[]>(`${this.url}/user/${userId}/allowance`);
}
}