is this issue currently blocking your project? (yes/no): no
is this issue affecting a production system? (yes/no): no
Context
node version: 1.72.2
module version:
environment (e.g. node, browser, native): vsc
used with (e.g. hapi application, another framework, standalone, ...): node-express
any other relevant information:
How can we help?
I would like to have two user inputs. I would like both to be optional. BUT if EITHER field is used they then both need to be required.
Example:
Should the user not want to input thier name, firstName and lastName it can be null or "" and still pass validation. But if the user inputs EITHER first or last name then BOTH will be required.
Support plan
Context
How can we help?
I would like to have two user inputs. I would like both to be optional. BUT if EITHER field is used they then both need to be required.
Example:
Should the user not want to input thier name, firstName and lastName it can be null or "" and still pass validation. But if the user inputs EITHER first or last name then BOTH will be required.
My Schema atm:
With the current Schema the user does need to completed both fields to pass validation BUT they are unable to leave both blank should they choose to.
With this schema both can now be null or empty but the .and() condition doesnt apply.
The last thing i tried was variation's of .when() but keep coming up with dependancy errors...
Is this possible?