You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.
I can't find the logic of verifying if a field is undefined when it's marked as required, before the beforeCreate!
Example: reference: {type: 'string', columnType: 'string', columnName: "reference", required: true},
then
Here I'm generating the reference in beforeCreate, which is logical. I should create a reference only here, it's simply a unique random string. So I'm sure that it will always be there.
But I have an error saying the reference is undefined while it's required, when I'm trying to create a new record of my model.
Of course when I remove required: true everything is fine, but that's not what I want.
The logical sequence is to check for undefined and do all the validations AFTER the beforeCreate function.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I can't find the logic of verifying if a field is undefined when it's marked as required, before the beforeCreate!
Example:
reference: {type: 'string', columnType: 'string', columnName: "reference", required: true},
then
Here I'm generating the reference in
beforeCreate
, which is logical. I should create a reference only here, it's simply a unique random string. So I'm sure that it will always be there.But I have an error saying the reference is undefined while it's required, when I'm trying to
create
a new record of my model.Of course when I remove
required: true
everything is fine, but that's not what I want.The logical sequence is to check for undefined and do all the validations AFTER the
beforeCreate
function.The text was updated successfully, but these errors were encountered: