@@ -72,22 +72,18 @@ const { Model } = require('objection');
7272
7373class User extends Model {
7474
75- static get tableName () {
76- return ' user' ;
77- }
75+ static tableName = ' user'
76+
77+ static jsonSchema = {
78+ type: ' object' ,
79+ required: [' firstName' , ' lastName' ],
7880
79- static get jsonSchema () {
80- return {
81- type: ' object' ,
82- required: [' firstName' , ' lastName' ],
83-
84- properties: {
85- id: { type: ' integer' },
86- firstName: { type: ' string' , maxLength: 45 },
87- lastName: { type: ' string' , maxLength: 45 },
88- status: { type: ' string' , enum: [' active' , ' disabled' ], default: ' active' },
89- },
90- };
81+ properties: {
82+ id: { type: ' integer' },
83+ firstName: { type: ' string' , maxLength: 45 },
84+ lastName: { type: ' string' , maxLength: 45 },
85+ status: { type: ' string' , enum: [' active' , ' disabled' ], default: ' active' },
86+ }
9187 }
9288
9389 static get relationMappings () {
@@ -132,22 +128,18 @@ const { Model } = require('objection');
132128
133129class Todo extends Model {
134130
135- static get tableName () {
136- return ' todo' ;
137- }
131+ static tableName = ' todo'
132+
133+ static jsonSchema = {
134+ type: ' object' ,
135+ required: [' userId' , ' text' ],
138136
139- static get jsonSchema () {
140- return {
141- type: ' object' ,
142- required: [' userId' , ' text' ],
143-
144- properties: {
145- id: { type: ' integer' },
146- userId: { type: ' integer' },
147- text: { type: ' string' },
148- complete: { type: ' boolean' , default: false },
149- },
150- };
137+ properties: {
138+ id: { type: ' integer' },
139+ userId: { type: ' integer' },
140+ text: { type: ' string' },
141+ complete: { type: ' boolean' , default: false },
142+ }
151143 }
152144
153145 static get relationMappings () {
0 commit comments