Hi tehre, I am playing around with the apiRouter from @vinxi/router. I've noticed that the event.context.params from the event passed to the API route handlers is empty, hence making functions like getRouterParam fail. I know that the params are passed as a second argument to defineEventHandler but I believe it would be good to pass them as pass of the event object to make it more inline with H3 (also making H3 code directly portable, which is my case).
Reading the API Handler code, I believe just adding the params object to event.context would be sufficient, I may be missing something but if I am not I would be happy to make that PR.
Hi tehre, I am playing around with the
apiRouter
from@vinxi/router
. I've noticed that theevent.context.params
from the event passed to the API route handlers is empty, hence making functions likegetRouterParam
fail. I know that the params are passed as a second argument todefineEventHandler
but I believe it would be good to pass them as pass of theevent
object to make it more inline with H3 (also making H3 code directly portable, which is my case).Reading the API Handler code, I believe just adding the
params
object toevent.context
would be sufficient, I may be missing something but if I am not I would be happy to make that PR.