sign up added
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
//import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
export interface ApiResult {
|
||||
page: number;
|
||||
results: any[];
|
||||
total_pages: number;
|
||||
total_results: number;
|
||||
}
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class WrenchServiceService {
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
getTopRatedMovies(page = 1): Observable<ApiResult> {
|
||||
return this.http.get<ApiResult>(
|
||||
`${environment.baseUrl}/movie/popular?page=${page}&api_key=${environment.apiKey}`
|
||||
);
|
||||
}
|
||||
|
||||
getMovieDetails(id: string): Observable<any> {
|
||||
return this.http.get<ApiResult>(
|
||||
`${environment.baseUrl}/movie/${id}?api_key=${environment.apiKey}`
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user