Guibi1 / SvelteKit-TypeSafe-API

Adding type safety to SvelteKit's server endpoints.
https://npmjs.com/sveltekit-typesafe-api
MIT License
7 stars 0 forks source link

GET Parameters? #1

Closed nickyhajal closed 1 year ago

nickyhajal commented 1 year ago

Thanks for this library! Finding it really helpful so far.

When I am trying to do a GET request, I don't seem to see where I should attach parameters in a typesafe way.

CleanShot 2023-08-08 at 19 01 17

Any suggestions?

Appreciate it!

Guibi1 commented 1 year ago

Hi! Thanks for you interest in the project! Adding type safety for the search params of a request is in my Todo list. For now you can't use the library with search parameters, so the workaround is to use a normal fetch...

I will use this issue to track the progress of that feature.

Guibi1 commented 1 year ago

This is now a feature in 3.2.0. You can declare a searchParams z.object in the validation schema and the library will handle the rest!