The Movie Database atbalsts

Hello everyone!

So, I'll try to keep this as short as possible even tho I don't know how possible it's gonna be. I'm trying to create an app that shows the 20 top rated movies and 20 upcoming movies on the front page when you open the app. Easy enough. I also have a search bar at the top where I can search for movies and get the results back. The issue is that I'm quite new to React and Frontend development in general (and programming too, I haven't really been programming too much) and I just don't know how to solve the issue I have. I also realized that I might have posted this in the wrong category first.

The issue is that, when I search for a movie, I want React to render a different component and take me to a different route, for example http://localhost:3000/searchresults/:keyword or something like that. I know how to set that up in App.js, with the routes and all that, but I just can't get it to work. Most recently, the issue is that I'm getting some sort of an error that the results I'm getting back from the API don't exist, or that they're undefined. Again, I'm not very good at this so I'm having some trouble with understanding what's wrong and what do I actually have to do to fix the issue.

If anyone could and would want to help, I'd love to hear your suggestions! I can give you the link to my GitHub repository so that you can download the code and maybe identify the issue in that way. Once again, I am very much aware that my code looks quite ugly, there's a lot of things that could and should be broken up in separate components or even some things that don't even make sense. I've been using ChatGPT to help me out with stuff and it's been quite useful so far, except that I'm stuck now and don't know how to solve this issue. Also, I'm aware that you should normally hide your API key or API Read Access Token, but I don't think I need to hide it right now.

https://github.com/IITheGameII/movie-app

Edit: Someone pointed out that I wasn't returning the res.json() in line and that's why I was getting undefined. Unfortunately, I still haven't been able to solve my entire issue with the app, showing the results in a separate component and all that, but this is a good start

Nevari atrast filmu vai TV pārraidi? Jāpiesakās, lai to izveidotu.

Vispārējs

s fokusēties uz meklēšanas joslu
p atvērt profila izvēlni
esc aizvērt atvērtu logu
? atvērt īsinājumtaustiņu logu

Informācijas nesēju lapās

b atgriezties (vai pie vecākiem, ja nepieciešams)
e doties uz labošanas lapu

TV sezonas lapās

(labā bultiņa) pāriet uz nākamo sezonu
(kreisā bultiņa) pāriet uz iepriekšējo sezonu

TV sērijas lapās

(labā bultiņa) pāriet uz nākamo sēriju
(kreisā bultiņa) pāriet uz iepriekšējo sēriju

Visās attēlu lapās

a atvērt attēla pievienošanas logu

Visās labošanas lapās

t atvērt tulkošanas atlasītāju
ctrl+ s iesniegt veidlapu

Diskusiju lapās

n radīt jaunu diskusiju
w pārslēgt skatīšanās stāvokli
p pārslēgt publisko/privāto
c pārslēgt aizvērt/atvērt
a atklāta darbība
r atbilde uz diskusiju
l doties uz pēdējo atbildi
ctrl+ enter iesniegt savu ziņojumu
(labā bultiņa) nākamajā lapā
(kreisā bultiņa) iepriekšējā lapa

Iestatījumi

Vēlies novērtēt šo vienumu vai pievienot to sarakstam?

Pieteikties