Bruno Predot

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

... ... @@ -48,7 +48,7 @@ export const useTMDB = function() {
* Fetch movie details by id.
* @param id
*/
const fetchMovieDetails = async (id: number) => {
const fetchMovieDetails = async (id: number|string) => {
try {
const response = await fetch(
`${apiUrl}/movie/${id}?api_key=${apiKey}&language=fr-FR`,
... ...
... ... @@ -2,7 +2,7 @@ export interface MovieInterface {
id: number;
adult: boolean;
backdrop_pat: string;
genre_ids: unknown[];
genre_ids: number[];
original_language: string;
original_title: string;
overview: string;
... ...
... ... @@ -23,13 +23,26 @@ export class Movie extends Model {
id: this.number(null),
adult: this.boolean(false),
backdrop_pat: this.string(null),
belongs_to_collection: this.attr(null),
budget: this.number(null),
genre_ids: this.attr([]),
genres: this.attr([]),
homepage: this.string(null),
imdb_id: this.string(null),
origin_country: this.attr([]),
original_language: this.string(null),
original_title: this.string(null),
overview: this.string(null),
popularity: this.number(null),
poster_path: this.string(null),
production_companies: this.attr([]),
production_cuntries: this.attr([]),
release_date: this.string(null),
revenue: this.number(null),
runtime: this.number(null),
spoken_languages: this.attr([]),
status: this.string(null),
tagline: this.string(null),
title: this.string(null),
video: this.boolean(false),
vote_average: this.number(null),
... ...