Bruno Predot

Mise à jour du model Movie + interface + composable TMDB.

@@ -48,7 +48,7 @@ export const useTMDB = function() { @@ -48,7 +48,7 @@ export const useTMDB = function() {
48 * Fetch movie details by id. 48 * Fetch movie details by id.
49 * @param id 49 * @param id
50 */ 50 */
51 - const fetchMovieDetails = async (id: number) => { 51 + const fetchMovieDetails = async (id: number|string) => {
52 try { 52 try {
53 const response = await fetch( 53 const response = await fetch(
54 `${apiUrl}/movie/${id}?api_key=${apiKey}&language=fr-FR`, 54 `${apiUrl}/movie/${id}?api_key=${apiKey}&language=fr-FR`,
@@ -2,7 +2,7 @@ export interface MovieInterface { @@ -2,7 +2,7 @@ export interface MovieInterface {
2 id: number; 2 id: number;
3 adult: boolean; 3 adult: boolean;
4 backdrop_pat: string; 4 backdrop_pat: string;
5 - genre_ids: unknown[]; 5 + genre_ids: number[];
6 original_language: string; 6 original_language: string;
7 original_title: string; 7 original_title: string;
8 overview: string; 8 overview: string;
@@ -23,13 +23,26 @@ export class Movie extends Model { @@ -23,13 +23,26 @@ export class Movie extends Model {
23 id: this.number(null), 23 id: this.number(null),
24 adult: this.boolean(false), 24 adult: this.boolean(false),
25 backdrop_pat: this.string(null), 25 backdrop_pat: this.string(null),
  26 + belongs_to_collection: this.attr(null),
  27 + budget: this.number(null),
26 genre_ids: this.attr([]), 28 genre_ids: this.attr([]),
  29 + genres: this.attr([]),
  30 + homepage: this.string(null),
  31 + imdb_id: this.string(null),
  32 + origin_country: this.attr([]),
27 original_language: this.string(null), 33 original_language: this.string(null),
28 original_title: this.string(null), 34 original_title: this.string(null),
29 overview: this.string(null), 35 overview: this.string(null),
30 popularity: this.number(null), 36 popularity: this.number(null),
31 poster_path: this.string(null), 37 poster_path: this.string(null),
  38 + production_companies: this.attr([]),
  39 + production_cuntries: this.attr([]),
32 release_date: this.string(null), 40 release_date: this.string(null),
  41 + revenue: this.number(null),
  42 + runtime: this.number(null),
  43 + spoken_languages: this.attr([]),
  44 + status: this.string(null),
  45 + tagline: this.string(null),
33 title: this.string(null), 46 title: this.string(null),
34 video: this.boolean(false), 47 video: this.boolean(false),
35 vote_average: this.number(null), 48 vote_average: this.number(null),