nickjantz
nickjantz
WWasp-lang
Created by nickjantz on 3/16/2024 in #đŸ™‹questions
useQuery in an eventHandler?
Is it possible to put useQuery in a click handler? Say I have a field that allows user to select a number, then I want to useQuery to fetch a custom query I wrote that queries the DB for a task with that number ID, whenever I do this I'm getting a react hooks issue about hooks can only be called in the body of a function component. My component is a function component, not sure what is going on but it seems to be related to the useQuery call as when I remove it the error goes away. I'd like to also use it to set state with reacts useState, but not sure how to manage that either.
5 replies
WWasp-lang
Created by nickjantz on 3/5/2024 in #đŸ™‹questions
Running alongside separate authed API?
Has anyone ran WASP front end alongside a separate API? My plan is to run WASP as the front end interface to a data visualization app and manage paying users in it. I have a standalone data API server already in place. My thought is that my other data API would need to interface with the WASP user management system to make sure that users requesting data and certain pages are actually at the right user tier to do that. Does anyone know if that's possible? Perhaps I could have my data API reading user rights from the same database or just calling a WASP api of some sort?
9 replies