I have a function which has a sequelize query
getsuperadmin = function(){
var user = User.findOne({
where: { roleid: 1 },
attributes:['userid','username','email']
}).then(user => {
});
return user;
}
I am trying to call this function getsuperadmin
in another function in the same js file and console.log as below
getadmindetails(){
console.log(getsuperadmin());
}
I am getting the below output in my console
Promise [Object] {
_bitField: 0,
_fulfillmentHandler0: undefined,
_rejectionHandler0: undefined,
_promise0: undefined,
_receiver0: undefined }
Why am I getting this output instead of the actual result