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
I noticed that in this merge #485 there is before: [] - i tried something like this:
constindex=defineEventHandler({handler: async()=>{returnmetapi().render(awaitprisma.user.findMany({}),)},before: [()=>{console.log('we are in before[]')returnauth.user()&&auth.user().isAdmin},],})
Reproduction
Just run the above code in a route
Describe the bug
not sure if i'm using before: [] incorrectly?
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
I think the documentation for defineEventHandler is incomplete.
there is no example of how to apply defineEventHandler with object syntax.
what if i want to create middleware at a non-global route level. did i make defineEventHandler in another file that accepts the object event then I called it on the body defineEventHandler by inserting an event object in the route level?
I think the documentation for defineEventHandler is incomplete.
there is no example of how to apply defineEventHandler with object syntax.
what if i want to create middleware at a non-global route level. did i make defineEventHandler in another file that accepts the object event then I called it on the body defineEventHandler by inserting an event object in the route level?
true. The docs are quite cryptic to say the least.
Environment
I noticed that in this merge #485 there is
before: []
- i tried something like this:Reproduction
Just run the above code in a route
Describe the bug
not sure if i'm using
before: []
incorrectly?Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: