added core services: entry, tmdb, toggle
This commit is contained in:
1 parent
08959c46b1
commit
daa948b9b9
4 files changed
+152
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable, map } from 'rxjs';
|
||||
import { Entry } from '../../shared/models/entry.model';
|
||||
import { EntryId } from '../../shared/models/entryId.model';
|
||||
import { EntryRating } from '../../shared/models/entryRating.model';
|
||||
// import { environment } from '../../../environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class EntryService {
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
// private apiUrl = environment.apiBaseUrl;
|
||||
private baseUrl = 'http://localhost:4000/api/v1';
|
||||
|
||||
addEntry(tmdb_id: string): Observable<Entry> {
|
||||
return this.http.post<Entry>(`${this.baseUrl}/entries`, { tmdb_id: tmdb_id });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user