Dear wix devs,
I’m running into a blocking problem for me. I’m trying to add a data hook. If my data.js file looks like this:
export function collection_afterUpdate(item) {
return item;
}
No problem. Hooks can be added to the collection
database. But if I do this:
export async function collection_afterUpdate(item) {
return item;
}
Problem! When I try to add this hook to the collection
database, it tells me: “Code error in Hooks file”. It doesn’t tell me what the error is, and it looks like correct JS to me. Also, the documentation and this forum thread tells me async should work (https://www.wix.com/code/home/forum/questions-answers/unique-db-fields).
In the meantime, I’ve found a work-around using Promises without async, but I like async so can anyone tell me what is going wrong?
Regards,
Henk