top of page

Forum Posts

erkoak
Sep 18, 2018
In Coding with Velo
I made a simple after insert hook to check the collection item against another collection. When it runs, it hits the true statement of if function and everything is fine, but the collection is not updated. I think i missed something simple or I have a basic lack of understanding of javascript... either or. here is my code: import wixData from 'wix-data'; export function EventReg_afterInsert(item, context) { let userEmail = item.email; console.log(userEmail); wixData.query("Members").eq("email", userEmail).find() .then((results) => { if (results.items[0].member === true) { item.member = true; console.log("member set to true"); console.log(item); } }) return item; } Any thoughts?
0
3
110

erkoak

More actions
bottom of page