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.3 Replies
Why do you want an optional parameter? I think you don't need to specify the optional, just leave it
:idOrSlug
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
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