Optional params in hono/client
It seems that it doesn't support optional params at all.
In hono I can specify optional parameters, but in hono/client this is not supported.
If I have a route with
/:idOrSlug?/invite
, then it will match /invite
and /:idOrSlug/invite
.
And if I insert the correct value for the hono client then everything will work, but if it is undefined it will just put the undefined value in the url as shown in the screenshot above.igmtink•21d ago
Why do you want an optional parameter? I think you don't need to specify the optional, just leave it
:idOrSlug
⚡Z.E.U.S⚡•20d ago
Because I need to invite to the system and organization (if idOrSlug exists). And I think that this must be in the hono/client since it is in hono
Nico•19d ago
I know this is not the answer you are looking for, but generally something like this should be a query parameter on frontend. So invite?refId=123. You can open up and issue as well, however, as I mention in front end this is not standard practice since it duplicates pages
Want results from more Discord servers?
More PostsSend data to HonoHi, how can i send Request body and file on same route.Client ipHow can I get the client ip, I need it for my rate limiterWhat is the best way to handle the error?What I want is to get the error from server to client using rpc + react query
1. Using `trycatch`
2Running `bun run dev` on a newly created Cloudflare Pages example spits an error```
bun run dev
$ vite
(!) Could not auto-determine entry point from rollupOptions or html files andconnect my hono application endpoints with swagger uihow i can use swagger ui with my hono applicationHow to set "credentials: true" in client side using rpc?I'm using rpc with react query on the client side, this kind of fetching has already credentials: trCookies doesn't processWhen I try to run in my middleware the following
```
setCookie(c, 'test', 'res', { maxAge: 60 * 60 use Context to get vars from wrangler.tomlhow can fix this code. i want to use my openaiApiKey from the wrangler.toml when i create an openai