Skip to content

Commit

Permalink
Fix few db queries using deprecated sequelize function
Browse files Browse the repository at this point in the history
  • Loading branch information
Keskimaki committed Aug 16, 2023
1 parent 965d3b7 commit 43e4dc2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ topicsRouter.post('/:id/copy', async (req, res) => {
order: [['createdAt', 'DESC']]
})

const from = await db.Topic.findById(req.params.id)
const from = await db.Topic.findByPk(req.params.id)

const secret_id = getRandomId()

Expand Down Expand Up @@ -134,7 +134,7 @@ topicsRouter.put(
res.status(500).json({ error: 'Something is wrong... try reloading the page' })
})
} else {
db.Topic.findById(req.params.id)
db.Topic.findByPk(req.params.id)
.then((topic) => {
if (!topic)
return res.status(400).json({ error: 'no topic with that id' })
Expand Down

0 comments on commit 43e4dc2

Please sign in to comment.