Hello everyone ! There are two models: Actors and Films. Many-to-Many connection.
I'm trying to write a CRUD but I have a problem with UpdatActor it only updates the Actor. How do I write UpdateActor () so that I can add another movie to the Actor?
async updateActor(req, res, next) {
try {
await Actor.update(req.body, {where:{
id:req.params.id
}})
let updated = await Actor.findByPk(req.params.id)
return res.json(updated)
} catch (err) {}
}