codyseibert / tab-tracker

A Vue.js / Express.js web application for keeping track of guitar tabs
MIT License
520 stars 197 forks source link

bookmark always returns null #20

Open akratzel opened 6 years ago

akratzel commented 6 years ago

Hi, so following Part 6 got me to my first error I couldn't solve yet.

In my BookmarksController.js my bookmark will always be null.

const {songID, userID} = req.query;
    const bookmark = await Bookmark.findOne({
           where: {
               SongId: songID,
               UserId: userID
           }
       });
res.send(bookmark || {});

And my bookmark.json file looks like this:

[
  {
    "SongId": 1,
    "UserId": 1
  }
]

Can you maybe have a short look on the repo or do you have any clue why it does not find anything? https://github.com/akratzel/guitar-tabs/tree/dev

Maybe a sequelize version issue?

Thanks!

negrodebobures commented 6 years ago

i've the same issue, you solved?

fuoridallarete commented 5 years ago

Have you solved the issue? My query just takes the songId but not the userId so it always gives me 500 error. Tried few things, but none worked..