changes to season main card

This commit is contained in:
X4Lo committed 2024-04-20 15:47:47 +01:00
1 parent 5b1b02cf61
commit 252d7093b2
5 files changed
+113 -18

No files matched your search

@@ -0,0 +1,12 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root',
})
export class EpisodeService {
private backend_apiUrl = 'http://localhost:4000/api/v1';
private apiAction = 'episodes';
constructor(private http: HttpClient) {}
}
@@ -1,6 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Season } from '../../shared/models/season.model';
import { Episode } from '../../shared/models/episode.models';
@Injectable({
providedIn: 'root',
@@ -24,4 +25,10 @@ export class SeasonService {
[null]
);
}
getSeasonEpisodes(id: number) {
return this.http.get<Episode[]>(
`${this.backend_apiUrl}/${this.apiAction}/${id}/episodes`
);
}
}