#Best solution for checks like unique username
6 messages · Page 1 of 1 (latest)
Thanks for posting in #1088161997662724167.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use [search.convex.dev](https://search.convex.dev) to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's #1228095053885476985 channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Would it be best to add the check directly into the Zod schema?
I'd check with a Convex query, one called api.users.usernameExists.
Yeah I have that exact endpoint, but would you place the query into a Zod validator, or into the form on submit function?
I don't want to overload the API for no reason so I'm thinking in the on submit.
Also, what's the recommended way to jsut fire a regular await fetch request with Convex?
Is this in React? convex.query() where convex is what you get from useConvex()