Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Issue in getTrendingMovies Function in Slider.jsx #1

Open
Shaad-Imran opened this issue Sep 27, 2023 · 1 comment
Open

Code Issue in getTrendingMovies Function in Slider.jsx #1

Shaad-Imran opened this issue Sep 27, 2023 · 1 comment

Comments

@Shaad-Imran
Copy link

The code currently looks like this:
const getTrendingMovies = () => {
GlobalApi.getTrendingVideos
.then(resp => {
console.log(resp.data.results);
setMovieList(resp.data.results);
})
}

GlobalApi.getTrendingVideos is a function, but it's missing parentheses for invocation. To fix this, it should be called as GlobalApi.getTrendingVideos().

Corrected Code:
const getTrendingMovies = () => {
GlobalApi.getTrendingVideos().then((resp) => {
console.log(resp.data.results);
setMovieList(resp.data.results);
});
};

@AbdullahZulfikar
Copy link

So where is the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants