Describe the bug
After updating admin-bro from 2.4.1 to 2.8.0 and admin-bro-sequelize from 0.4.0 to 0.5.1 there is an issue with JSONB fields when adding new resources via "new" action.
The default value described in Sequelize model id a JSON: { ".": "." }, but the record that's inserted into the database is set to [["."]] which causes issues when frontend expects an actual object.
Installed libraries and their versions
admin-bro@2.8.0
admin-bro-sequelize@0.5.1
To Reproduce
Steps to reproduce the behavior:
Create a Sequelize model with a JSONB field having a default value i. e. as described above ({ ".": "." }) and add the resource to AdminBro.
Navigate to the resource in admin, press "New" and fill in required fields (note: the JSONB field is not a part of the form)
Submit the form.
Check what's actually inserted into the database, the value for JSONB field will be [["."]]
Expected behavior
The default value from Sequelize model is inserted, or an empty JSON object.
Describe the bug After updating admin-bro from 2.4.1 to 2.8.0 and admin-bro-sequelize from 0.4.0 to 0.5.1 there is an issue with JSONB fields when adding new resources via "new" action.
The default value described in Sequelize model id a JSON:
{ ".": "." }
, but the record that's inserted into the database is set to[["."]]
which causes issues when frontend expects an actual object.Installed libraries and their versions
To Reproduce Steps to reproduce the behavior:
{ ".": "." }
) and add the resource to AdminBro.[["."]]
Expected behavior The default value from Sequelize model is inserted, or an empty JSON object.