我正在尝试为我的一个具有JSONB
数据类型的模型显示和启用编辑。
导师模型
const Instructor = sequelize.define('Instructor', {
id: {
type: Sequelize.INTEGER,
autoIncrement: true,
primaryKey: true
},
submission: {
type: DataTypes.JSONB,
allowNull: false
},
}, {});
资源定义
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)