How to validate using nested models/detect if code is running server side or client side? #4658
Unanswered
stephaniesyed
asked this question in
Q&A
Replies: 0 comments
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.
-
I have a validation function that needs to get info on nested data to validate:
Essentially, when running client side,
payload
isn't populated as described in the documentation. Ideally, for server side validation I want to use the local API, but I can't use that client side. Is there an established pattern for defining functionality differently depending on where the code is executing? That seems like a common problem others would have run into.I can define the method like this:
but that check feels brittle
Beta Was this translation helpful? Give feedback.
All reactions