Hello, everybody.
Please check this code.
// Update (or create) the product statistics.
async function updateStatistics(isRecommended) {
let stats;
wixData.query(“service_data”)
.eq(“service”, serviceId)
.find()
.then( (results) => {
console.log(results);
// function that uses results
calculate( results )
})
I think that calculate function should be executed only after the results have arrived.
But results arrive after the calculate function executed.
Is there any way that I can execute calculate function after the response arrived?
Please help me…