Hey guys, does anyone knows why this code is not working?
Im using beta v3 Payload version:
hooks: {
afterChange: [
async ({ doc, req }) => {
//update expedition applications
const expedition = await req.payload.findByID({
collection: 'expeditions',
id: doc.expedition,
})
if (expedition) {
await req.payload.update({
collection: 'expeditions',
id: doc.expedition,
data: {
title: 'costa rica'
},
})
}
return
when debugging with console logs, I can see the doc info is all the related to the current application Im creating, then it finds properly the expedition (all the info there), but when doing update, it just keeps loading, there is no error logs, just keeps to infinite until I refresh the browser or kill the app.