{movie.overview}
diff --git a/src/objects/tmdb.tsx b/src/objects/tmdb.tsx index 7e80d61..94d3797 100644 --- a/src/objects/tmdb.tsx +++ b/src/objects/tmdb.tsx @@ -1,5 +1,6 @@ import axios from 'axios' import * as auth from '../auth.json'; +import { Movie } from './movie-wall'; import { Config } from '../App'; const tmdb = axios.create({ @@ -34,10 +35,10 @@ export default { } }, /** - * Calls TMDB/similar + * Calls TMDB/similar, then fires the callback with res.data.results.unshift(movie) as argument */ - getSimilar: async function({ language, page }: Config, id: number, callback: Function) { - let res = await tmdb.get(id + '/similar', { + getSimilar: async function({ language, page }: Config, movie: Movie, callback: Function) { + let res = await tmdb.get(movie.id + '/similar', { params: { language, page @@ -45,8 +46,9 @@ export default { }) console.log(res) if (res.status === 200) { - res = res.data.results - callback(res) + const array: Array