Allow for early return in beforeOperation hooks + implementation #7199
r1tsuu
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Proposal: allow for early return in
beforeOperation
hooks.Why? There are several possible usages:
find
,update
etc.) will iteract with your data storage and you'll have a free admin UI for them, as well you don't need to sync anything.Of course, it's up to us to make sure that returned data is correct.
Usage:
Possible implementation:
Pros:
notFound
andredirect
. Well, they actually do the same https://github.com/vercel/next.js/blob/5c9706ed1f5199b135dab850100e199f76d6a0a1/packages/next/src/client/components/not-found.ts#L21beforeOperation
return value is used to modify operationargs
.Cons:
Beta Was this translation helpful? Give feedback.
All reactions