I'm likely missing something here, but am trying to call two update queries using a forEach loop, but need to wait until that loop is done before refreshing the page. I have tried using async await everywhere I can and calling refreshTable query on success of the javaScript query, but that didn't work either. The only thing I've had work is is the timeout function I have commented out.
async function update1(item) {
await updateQuery1.trigger({
additionalScope: {
scope1: textBox.value,
scope2: item.value,
},
});
}
async function update2(item) {
await updateQuery2.trigger({
additionalScope: {
scope1: textBox.value,
scope2: item.value,
},
});
}
await table.value.forEach(await update1);
await table.data.id.forEach(await update2);
//setTimeout(() => {
refreshTable.trigger();
//}, 500);