qwik-city: add validator$ to server$ #24
Closed
wmertens
started this conversation in
Proposals For Qwik
Replies: 1 comment
-
|
closing this in favor of #18 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
server$can be called by anyone, with any arguments. It's easy to write aserver$without realizing that your arguments can be malicious.Proposed Solution / Feature
What do you propose?
server$ has a second argument for options. Add a
validate$option. Also allow passing a function directly for the second argument, it is then treated asvalidate$.We already have validators, so we should keep the same API.
Code examples
Links / References
https://qwik.dev/docs/validator/
Beta Was this translation helpful? Give feedback.
All reactions