@josephchancewatkins
DAMN! Sorry —> MY FAULT !
My code was not complete! I forgot something…try this one…
var DB_ID = "your_DATABASE_ID_here";
var DB_FIELD = "your_DB_FIELD_here";
let myRequestResult = await get_BackendData(DB_ID, DB_FIELD);
console.log(myRequestResult);
export function get_BackendData(DB_ID, DB_FIELD){
return wixData.get(DB_ID, DB_FIELD)
.then( (res) => {console.log("Res: ", res);
let items = res; console.log("Items: ", items);
return(items);
}).catch((err)=>{console.log("ERROR: ", err); return(err);});
}
ADDITIONAL-INFO: Add → async ← to your onReady-Code-Part!
Or if you do not want to use async-await, you can do it with a → .then(()=>{}-method
get_BackendData(DB_ID, DB_FIELD).then((res)=>{console.log(res);});
I think the rest will be clear for you, it seems you are not a total beginner.
BTW: Not sure if this return is neccessary at this line:
return wixData.get(DB_ID,DB_FIELD)
Test it out!