File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import AdminBro from 'admin-bro'
9
9
import { buildRouter } from '@admin-bro/express'
10
10
import AdminBroSequelize from '@admin-bro/sequelize'
11
11
12
+ import userAdmin from './users/user.admin'
13
+
12
14
import connect from './connect'
13
15
14
16
const PORT = 3000
@@ -19,9 +21,10 @@ const run = async () => {
19
21
const app = express ( )
20
22
const admin = new AdminBro ( {
21
23
databases : [ sequelize ] ,
22
- resources : [
23
-
24
- ] ,
24
+ resources : [ {
25
+ resource : sequelize . models . User ,
26
+ options : userAdmin ,
27
+ } ] ,
25
28
} )
26
29
27
30
admin . watch ( )
Original file line number Diff line number Diff line change
1
+ import { ResourceOptions } from 'admin-bro'
2
+
3
+ const options : ResourceOptions = {
4
+ properties : {
5
+ json : {
6
+ type : 'mixed' ,
7
+ } ,
8
+ } ,
9
+ } as ResourceOptions
10
+
11
+ export default options
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ const build = (sequelize: Sequelize) => {
15
15
type : DataTypes . STRING ,
16
16
// allowNull defaults to true
17
17
} ,
18
+ json : {
19
+ type : DataTypes . JSONB ,
20
+ defaultValue : { '.' : '.' } ,
21
+ } ,
18
22
} , {
19
23
// Other model options go here
20
24
} )
You can’t perform that action at this time.
0 commit comments