Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: assign table column discrim before setting field discrim
Mongoose now saves objects with keys in the order the keys are specified in the schema, meaning the table column discriminator would not have been applied at the time the table field was assigned as a discriminator to the form's form fields. This resulted in a bug where table columns did not have a discriminated schema causing uncaught errors to be thrown when a table field was submitted, such as "UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'selectedValidation' of undefined" as the field did not contain the necessary discriminated column schema props due to not being assigned prior to assigning the TableFieldSchema discriminator. See https://mongoosejs.com/docs/migrating_to_6.html#schema-defined-document-key-order
- Loading branch information