Hello,
My app is live here, https://brians-movie-database-1.herokuapp.com/movies but because of the isAdmin persmissions, I cannot add a movie to the database. I thought I changed the data in the MongoDB Atlas database as seen in this screenshot, https://drive.google.com/file/d/1H2uGTu6y9Ya-rHI-aXiLO851JPZ7dfN3/view?usp=sharing
but I still don’t have permissions to add a new movie or if I DO have permissions, I cannot add a movie because the genre dropdown menu for the movie form does not have any genres to choose from. Do I need to add seed data to the database in MongoDB Atlas? Maybe I need to make a genre table and those genres will populate the genre dropdown in the movie form? I am not entirely clear on how to create new tables in the MongoDB Atlas, but will look at the help docs. Please let me know if I am on the right path. Thanks!
OK, so what I ended up doing is using Postman to connect to the production API ([myBackend].herokuapp.com/api/genres) However, if I tried to post a new genre, I would get access denied. This is because in the VIDLY-API-NODE project the default.json file is set to “RequiresAuth”: true I had to change that back to false and then push the change to my Heroku repo. Then I was able to POST a new genre to my database, which I could view the changes on MongoDB Atlas. ANY logged in user can Add a movie, however, only an admin can delete a movie. Once I was finished adding the genres by changing the “requiresAuth” in the VIDLY-API-NODE to false, I then changed it back to true in order to ensure only authorized users have to be logged in in order to CREATE, UPDATE, and (if an admin) DELETE a movie.