Skip to content

How to update current document in afterRead hook? #1764

Discussion options

You must be logged in to vote

I solved it for now using an early return with

req.payloadAPI === 'local' && operation === 'read'

However, I would still be interested in suggestions for other solutions, since the potential for an endless loop is still present, if the data changes in a specific way. I would still prefer to be able to disable hooks on the update call.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by christian-reichart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant