I was doing post-update validation inside CollectionAfterChangeHook and throwing errors if something went wrong down the line (in another system which was called using APIs).
It worked well until I realized this one
very important non explicit consequenceof throwing errors inside CollectionAfterChangeHook.
⭕ After the error, when user hits SAVE again, a
new, duplicate,object is created, not updated as it would be when no errors are throw.
@KasparTr if you have time please open an issue, this sounds like something that might need to be looked at and fixed in core?
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.