I have i table called Orders and another table called Cupons, this tables has a association many to one, Ordes has many cupons, and cupons belongs to order, i need to update the status of my cupom when i associate the cupons to a order, i tried this way but doesn't work
await item.addCupons(cupom.id, { // the item is the order created
through: {
afiliado_id: afiliadoId, // and update the afiliado id
status: 'validado' // update de status of cupon to 'validado'
}
})
````
Via Active questions tagged javascript - Stack Overflow https://ift.tt/Spcd8nH
Comments
Post a Comment