Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add.js file #34

Open
nataliarusu opened this issue Jan 25, 2023 · 0 comments
Open

add.js file #34

nataliarusu opened this issue Jan 25, 2023 · 0 comments

Comments

@nataliarusu
Copy link

const {listGenres}=require('../model/genres'); //this works fine

function get(req, res) {
const title = "Add film";
const categories = listGenres().map(genre=>genre.genre_name);//this will give you the list of all genres

//["Horror","Sci-Fi","Drama","Comedy","Action","Thriller","Mystery","Crime","Adventure","Fantasy","Biography","War","History","Music

You can console.log categories without map() which gives you array of object from db
I think this is great, you managed to get data from db
Good luck with handling the data from bd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant