Nodejs AdminBro show/edit JSONB field

341 Views Asked by At

I am trying to display and enable edit for one of my models that has a JSONB datatype.

instructor model

const Instructor = sequelize.define('Instructor', {
    id: {
        type: Sequelize.INTEGER,
        autoIncrement: true,
        primaryKey: true
    },
    submission: {
        type: DataTypes.JSONB,
        allowNull: false
    },
}, {});

resource definition

const adminBro = new AdminBro({
    resources: [{resource: Provider}, {
        resource: Instructor,
        options: {
            properties: {
                submission: {
                    type: 'mixed',
                    show: true,
                    filter: false,
                    edit: true
                },
            },
        }
    }],
})

const router = AdminBroExpress.buildRouter(adminBro)

app.use(adminBro.options.rootPath, router)

Here is the UI result in admin: enter image description here

0

There are 0 best solutions below