I have a function which resolves in the first then:
var a_p = sc.getAllPatientData()
.then(res => {
console.log(res) // logs {data:array[4]}
return res}).then(res=>{return res.data})
.catch(error => {console.log(error)});
But the var a_p
returns a pending promise. I do not know how to resolve this
to extract the data. I would like to make it return the {data:array[4]}
object seeing as it has clearly fulfilled