|
|
@ -4,7 +4,7 @@ import { Injectable, Inject } from "@angular/core";
|
|
|
|
import { empty, Observable, throwError } from "rxjs";
|
|
|
|
import { empty, Observable, throwError } from "rxjs";
|
|
|
|
import { catchError } from "rxjs/operators";
|
|
|
|
import { catchError } from "rxjs/operators";
|
|
|
|
|
|
|
|
|
|
|
|
import { IMovieDbGenre, IMovieDbKeyword } from "../../interfaces";
|
|
|
|
import { IMovieDbKeyword } from "../../interfaces";
|
|
|
|
import { ServiceHelpers } from "../service.helpers";
|
|
|
|
import { ServiceHelpers } from "../service.helpers";
|
|
|
|
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
@Injectable()
|
|
|
@ -23,7 +23,7 @@ export class TheMovieDbService extends ServiceHelpers {
|
|
|
|
.pipe(catchError((error: HttpErrorResponse) => error.status === 404 ? empty() : throwError(error)));
|
|
|
|
.pipe(catchError((error: HttpErrorResponse) => error.status === 404 ? empty() : throwError(error)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public getGenres(media: string): Observable<IMovieDbGenre[]> {
|
|
|
|
public getGenres(media: string): Observable<IMovieDbKeyword[]> {
|
|
|
|
return this.http.get<IMovieDbGenre[]>(`${this.url}/Genres/${media}`, { headers: this.headers })
|
|
|
|
return this.http.get<IMovieDbKeyword[]>(`${this.url}/Genres/${media}`, { headers: this.headers })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|