// Filename: backend/aModule.jsw (web modules need to have a .jsw extension)
import wixData from 'wix-data';
export function query(id) {
wixData.get("Articles", id)
.then( (results) => {
console.log(results)
let item = results
} )
return item //ERROR: 'item' is not defined
}
I can’t figure out a way to return the value, I’ve tried a global var but does not work