First comit
This commit is contained in:
15
src/app/core/services/genre-api.service.ts
Normal file
15
src/app/core/services/genre-api.service.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { Genre } from '../models/api.models';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class GenreApiService {
|
||||
private readonly http = inject(HttpClient);
|
||||
private readonly apiUrl = `${environment.apiRestUrl}/genres`;
|
||||
|
||||
getGenres(): Observable<Genre[]> {
|
||||
return this.http.get<Genre[]>(this.apiUrl);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user