Closed AlbertSabate closed 2 months ago
@AlbertSabate This route
does not come from Brisa, it comes from Bun:
https://bun.sh/docs/api/file-system-router
The file-system-router is used, and the route comes with these parameters. Many times it is the same, true, but there are differences in [dynamic]
routes.
I recommend you to read the Bun documentation about query and params, I hope it helps!
Bun docs are correct. According to the docs:
params?: Record<string, string>;
query?: Record<string, string>;
I don't know where the array comes from ... Also in bun params are params and query is query. Brisa mix them up.
It is an issue with Bunjs. We have opened a bug on their tracker.
More info: https://github.com/oven-sh/bun/issues/12206
Brisa now uses its own implementation and this bug has been fixed internally. I am closing the issue.
Currently for an url like:
http://localhost:3001/en/admin/6679fbe17b41431a977163fd/providers/create
where6679fbe17b41431a977163fd
is defined as[businessId]
.console.log(route.query.businessId, route.params.businessId);
returns:
I won't expect an array on this scenario. I will expect query for ?success=true and params for /lala/[businessId]/lolo.
Maybe query should be called searchparams???? or query be actually both. Then has params and searchparams??