I have the following code.
I get the data from db inside the .then . i want to use the var data = data.get({ plain: true })
data outside the then.. how can i do this.
const datas = roleService.getRoleById(1)
.then(data => {
var data = data.get({ plain: true })
console.log(data.get({ plain: true }))
// return data.get({ plain: true })
}
)
.catch((error) => res.status(400).send(error));
Thanks in advance.