Missing parameter for route when using glob pattern

Hi all,

So I’m trying to change a couple of my routers to use the glob param pattern, in order to work with nested items, e.g.:

<Route path='/category/{categoryIds...}/edit' page={CategoryEditCategoryPage} name='editCategory' />

This is working fine when I manually enter the URL, but I’m not sure if I’m getting the syntax correct when creating navigate links. In my list view I’ve got view and edit link, e.g.:

<Link to={routes.editCategory({ 'categoryIds...': category.id })}>Edit</Link>

It seems like both of these are throwing the missing parameter error (commenting them out fixes allows the page to load):

I’m guessing the param syntax isn’t correct (I can’t find any info in the docs about usage - Router | RedwoodJS Docs) but my IDE complains if I try and change it to anything else.

Thanks for any help!

Hmm, so it actually looks to be working fine if you ignore the TS error - perhaps a bug?

TS2345: Argument of type ‘{ categoryIds: any; }’ is not assignable to parameter of type ‘{ “categoryIds…”: string; } & QueryParams’. Property ‘“categoryIds…”’ is missing in type ‘{ categoryIds: any; }’ but required in type ‘{ “categoryIds…”: string; }’.

Hi @cattre. Sounds like you’ve found a proper bug. Can you please file an issue on our GitHub page? If you also include an easy way for us to reproduce the error it’s more likely we can solve it faster :slight_smile:

Done!