llllllll-l / TripMDB

A fun way for movie nerds to find their next trip
2 stars 0 forks source link

Implement a searchfield in homepage #33

Open llllllll-l opened 5 months ago

llllllll-l commented 5 months ago

Search Field Functionality on the Homepage

Description:

The homepage features two search fields where users can input the name of a movie/location to find related filming locations/movies. Users enter a string representing the movie name/location, and the system performs a search operation using a findAsync function to identify if the entered movie/location exists in the database. Upon submission, if the movie exists, the system retrieves and displays an array of locations associated with the movie and vice versa. However, if the name is not provided or if the entered movie/location does not exist, an error message is generated, indicating that a name must be entered or that the searched movie/location does not exist.

Details:

The homepage displays two search field where users can input the name of a movie/location. Users are encouraged to input a movie/location name into the search field to find related filming locations/movies. Upon submission, the system processes the entered name using a findAsync function to search for its existence in the database. If the name exists in the database, the system retrieves and displays an array of filming locations/movies associated with the movie. The displayed locations includes details such city, country. the displayed movies includes details such as director, releaseYear. In the event that the name field is left empty or if the entered name does not exist in the database, the system generates an error message. The error message informs the user that a name must be entered to proceed with the search or that the searched name does not exist in the database. The error message is displayed near the search field to ensure user visibility and clarity.

llllllll-l commented 5 months ago

I have made the search function to work on a local array och the same data in DB to display only the moves which Title includes users search input.

I have not implemented any logic for searching by location