Film Finder

Hello, I just finished the ‘Film Finder’ practice project
(https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-22-async-javascript-and-http-requests/modules/wdcp-22-learn-javascript-syntax-requests/projects/js-film-finder)
and upon finishing and playing around with application I don’t believe it works. Regardless of what genre I pick I noticed I still get the same/ a very similar set of movies. This seems to also be the case in the guided video attached to the project. When fast forwarding to the end of the video I noticed he switches the genre to ‘fantasy’ and still gets an action oriented movie recommendation. Am I the only one who noticed this?

Hi! I’m new in the community forums, and I will try to do my best on helping you. I’ve just finished coding, so there might be some things that I may not be completely familiar with, particularly in regards to someone else’s code, so please bare in mind.
Did you notice something strange when logging into the console the results of each of the console? Did you get the results as such as those refered in the hints?
Maybe once that info is checked, we can move on and try to find where the error might be.
Thank you for your patience!

I’ve been looking through some other forums and pages, and most reached the conclussion that maybe there’s a problem inside the getGenres() function:

const getGenres = async () => {
  // ...
  const requestParams = `?api_key=${tmdbKey}&with_genres=${selectedGenre}`;
  // ...

Notice the second key=value parameter? Maybe there is where you might be missing the ‘s’, so the whole promise doesn’t return the expected value, thus never showing any other genre than ‘Action’.
Well, I hope this have helped you on your coding.
I will be doing the additional challenges, so maybe we end up seeking for help on the same issues, so heads up!
Happy coding!

Hi All,

Any recommendations on how to keep the API key private from the client-side? Or, since we are only making GET requests using a free API, is it not necessary to make the key private? I completed the project and would like to push it to GitHub, but I know sharing APIs keys publicly is a big no-no from a security perspective. Thanks!

you could have a input box on the webpage that would have the user type in their API key into the webpage;

In the html for the webpage you could have

<label for="api-key">Type your IMDB API key in to make the page work.</label>
<input id="api-key" type="text" />

and the JavaScript could be

const apiKeyBox = document.getElementById("api-key");
let tmdbKey = "";
apiKeyBox.onchange = () => { tmdbKey = apiKeyBox.value; };
1 Like