Interfaces: create and split shows-api.ts

This commit is contained in:
Toast 2025-01-28 12:07:44 +01:00
parent 0a6fda1512
commit 22cc1dcc01
4 changed files with 10 additions and 8 deletions

View file

@ -1,9 +1,3 @@
export interface ShowsApiResponse {
status: string
shows: Show[]
totalShows: number
}
export interface Show {
_id: string
title: string

View file

@ -0,0 +1,7 @@
import {Show} from './show';
export interface ShowsApiResponse {
status: string
shows: Show[]
totalShows: number
}

View file

@ -1,6 +1,7 @@
import {Component, inject} from '@angular/core';
import {ShowsApiService} from '../../services/shows/shows-api.service';
import {Show, ShowsApiResponse} from '../../shows-api';
import {Show} from '../../interfaces/show';
import {ShowsApiResponse} from '../../interfaces/shows-api-response';
@Component({
selector: 'app-shows',

View file

@ -1,7 +1,7 @@
import {inject, Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';
import {ShowsApiResponse} from '../../shows-api';
import {ShowsApiResponse} from '../../interfaces/shows-api-response';
@Injectable({
providedIn: 'root'