You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you return a value other that the doc from the beforeRead or afterRead collection hooks, the response is not changes.
I suspect this is something to do with the fact that req is not longer one of the args that the hook provides (which is different from what the docs say). Ideally req would still be an argument you get so you can return req.status but failing that, the value you return should be what's returned in the request
Link to reproduction
No response
Payload Version
3.0.0-beta.77
Node Version
v20.15.0
Next.js Version
15.0.0-canary.104
Describe the Bug
When you return a value other that the doc from the beforeRead or afterRead collection hooks, the response is not changes.
I suspect this is something to do with the fact that
req
is not longer one of the args that the hook provides (which is different from what the docs say). Ideallyreq
would still be an argument you get so you canreturn req.status
but failing that, the value you return should be what's returned in the requestReproduction Steps
curl http://localhost:3000/api/article
curl http://localhost:3000/api/article/1
The result will be the document or a collection of documents
Adapters and Plugins
db-postgres
The text was updated successfully, but these errors were encountered: