Closed tmarnet closed 11 months ago
I guess that this is applicable only to named action?
You rock, by finding all this π
I updated the Stackblitz to include a default action as well.
It looks like this is broken for both default and named actions since the plugin treats default actions as named ones (by appending /default
):
I almost feels embarrassed! lol. I'll fix this soon π
You shouldn't π
But let me rectify my previous comment:
appendSp
works fine (see this new Stackblitz: https://stackblitz.com/edit/github-b9auqn)appendSp
doesn't behave properly (see the original Stackblitz: https://stackblitz.com/edit/github-nxv4s3)Hooo, but you can't have a named & default at the same time?!
https://kit.svelte.dev/docs/form-actions#named-actions
Anyway, I'll fix the SearchParam stuff π
Didn't know that, TIL!
Thanks π
Hooo, you get a warning, only when you start using it:
Error: When using named actions, the default action cannot be used. See the docs for more info: https://kit.svelte.dev/docs/form-actions#named-actions
I guess that I can put the warning directly directly when I see this
CoooooooL stuff
HΓ©hΓ©hΓ©, new log coming:
π vite-plugin-kit-routes@0.1.4
it out. π
Could you try and let me know ? I let you close the issue if it's solved π
Thx to you I even can put out more content: https://x.com/jycouet/status/1728489740184248599?s=20 π
π π π
Awesome!
It's working fine with vite-plugin-kit-routes@0.1.4
, thanks!
Closing this issue.
Describe the bug
Configuring and using search params on actions currently doesn't work properly because we're appending the
?
character at the begining of the search params, but actions paths already include this?
, so in that case we should be using&
instead.Your Example Website or App
https://stackblitz.com/edit/github-nxv4s3
Steps to Reproduce the Bug or Issue
/about/+page.server.ts
file with the following content:export const actions = { withSearchParam(event) { console.log('Received redirectUrl', event.url.searchParams.get('redirectUrl')); } } satisfies Actions;
kitRoutes
with the following:Go!
button form on the/about
page and notice that the form action equals/about?/withSearchParam?redirectUrl=%2Fabout
when it should in reality be/about?/withSearchParam&redirectUrl=%2Fabout
.Expected behavior
When appending search params to an action we should use the
&
character instead of the?
character.Screenshots or Videos
No response
Platform
vite-plugin-kit-routes
: 0.1.3Additional context
No response