Hello everyone, I’m struggling with a problem where I am unable to correctly assign a value from the console to a variable. Every time I try to execute it, an error occurs like this, even though I have successfully fetched the user_id record from the login page to the log page. I really need to ensure that the value is assigned correctly for my query but it seems quite challenging. Your assistance would be greatly appreciated.
Below is the code snippet:
async loadUsers(){
return new Promise(resolve => {
this.storage.get('storage_xxx').then((res) => {
let body = {
aksi: 'load_users',
user_id: console.log(res.user_id)
}
this.accsPrvds.postData(body, 'proses_api.php').subscribe((res:any)=>{
for(let datas of res.result){
this.users.push(datas);
}
resolve(true);
});
});
});
}