codyseibert/tab-tracker

bookmark always returns null

Opened this issue · 2 comments

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!

i've the same issue, you solved?

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..