Interfaces: add genres to api responses
This commit is contained in:
parent
1dd0333bc3
commit
70f7738966
3 changed files with 7 additions and 3 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import {Show} from './show';
|
||||
import {Genre} from './genre';
|
||||
|
||||
export interface ApiIdResponse {
|
||||
status: string
|
||||
show: Show
|
||||
show?: Show
|
||||
genre?: Genre
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
import {Show} from './show';
|
||||
import {Genre} from './genre';
|
||||
|
||||
export interface ApiResponse {
|
||||
status: string
|
||||
shows: Show[]
|
||||
shows?: Show[]
|
||||
genres?: Genre[]
|
||||
totalShows: number
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export class ShowsComponent {
|
|||
this.toastService.show(loadToast);
|
||||
this.api.getShows().subscribe({
|
||||
next: (response: ApiResponse) => {
|
||||
this.shows = response.shows;
|
||||
this.shows = response.shows ?? [];
|
||||
}, error: (err: any) => {
|
||||
console.error("Error: ", err);
|
||||
}, complete: () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue