Prajwal0225 / My-Favorite-SuperHero

πŸ¦Έβ€β™‚οΈ My Fav Superhero: Discover superhero images in a click! Search your heroes or get random image.
https://my-favorite-super-hero-one.vercel.app/index.html
MIT License
24 stars 84 forks source link

No display whenever you try to search for a superhero name #59

Closed Pavilion-devs closed 1 year ago

Pavilion-devs commented 1 year ago

I tried searching for a wrong superhero name and nothing displayed. Mind if I take on this issue @Prajwal0225

github-actions[bot] commented 1 year ago

πŸ‘‹ @Pavilion-devs Thank you for raising an issue. We will investigate the matter and get back to you as soon as possible πŸš€. Please make sure you have given us as much context as possible. Additionally, consider giving our repository a star. ⭐ It will motivate us to do more!

Prajwal0225 commented 1 year ago

What you are going to do to solve this issue?

Pavilion-devs commented 1 year ago

I'm getting an error "TypeError: Cannot read properties of undefined (reading '0') at script.js:23:32" which means the result array is empty when the superhero cannot be found. So to clear the error we will have to check if the results error exists and if it contains any elements before accessing the first element (json.results[0]). @Prajwal0225

Pavilion-devs commented 1 year ago

@Prajwal0225 I have fixed this issue already. Should I create a PR ?

Prajwal0225 commented 1 year ago

Can you do something like If the user enters an incorrect superhero name, it will display the message, 'A superhero with this name does not exist on the website.

Pavilion-devs commented 1 year ago

Yes @Prajwal0225 . I already did that but I need your permission to push and make a PR ?

Prajwal0225 commented 1 year ago

Please make a Pr my cloning updated code from the repo.

Mohd786-hub commented 1 year ago

please assign this to me so that i contribute to this hactoberfest 2023 . i have excellent knowledge of web dev and you can also check my projects in my repositories.

Pavilion-devs commented 1 year ago

Already done @Prajwal0225 @Mohd786-hub. Just made a PR on it. You can check other issues.

himanshu181749 commented 1 year ago

@Prajwal0225 i've raised a PR please have a look...