From some reason the afterUpdate() hook doesn’t work for me when I run a sandbox-to-live synchronization . The live collection gets updated but it looks like it doesn’t trigger the afterUpdate() hook on the live environment.
Does it work for you?
So what do you say? Isn’t it supposed to trigger on db sync?
Hey J.D. did you figure this out? If you did/didn’t, can you post your code?
No. I did not. Are you having the same issue?
@jonatandor35 More like I’m trying to understand if I can return a promise to the _afterUpdate hook, or does it have to be an item object. Do you know?
I want to run another query in the afterUpdate hook to edit the same item, so if I can return a promise with the resolved item that would be awesome.
@christopher-derrell I believe you can (but maybe not with sandbox synchronization.
P.S.
I use the afterUpdate() hook to update a copy of the main collection that should reflect the main collection data, and it works well except for this issue.
@jonatandor35 Ok great, thanks. I just tested it out, and it worked great
@Yisrael, shouldn’t an afterUpdate hook trigger when you sync the sandbox to live?
No, syncing does not trigger hooks.
@yisrael-wix so what can I do if I want a certain process to run after I sync the collection? Nothing?