Handling Default Values in Encoded Schemas
Hi! Might be a stupid question but I'm having trouble with default values / constructors in Schema.
I have the following schema where I would want
However, what I pass to my frontend is
How do I define a default value for it? I basically want the same constructor as the original
I have the following schema where I would want
dueDate to have a default value of the current date. This works when making an instance of Chore (I see a DateTime object being created with the current date).However, what I pass to my frontend is
ChoreEncoded. This way there are no options / DateTime objects, they are all optional properties & plain strings, since this plays nice with <input> elements. However when the form is instantiated client-side, dueDate is undefined!How do I define a default value for it? I basically want the same constructor as the original
Chore, but where the DateTime is encoded to a string. Is this possible?