feat: save page
This commit is contained in:
		| @@ -49,11 +49,19 @@ module.exports = class Page extends Model { | ||||
|           to: 'users.id' | ||||
|         } | ||||
|       }, | ||||
|       editor: { | ||||
|         relation: Model.BelongsToOneRelation, | ||||
|         modelClass: require('./editors'), | ||||
|         join: { | ||||
|           from: 'pages.editorKey', | ||||
|           to: 'editors.key' | ||||
|         } | ||||
|       }, | ||||
|       locale: { | ||||
|         relation: Model.BelongsToOneRelation, | ||||
|         modelClass: require('./locales'), | ||||
|         join: { | ||||
|           from: 'users.locale', | ||||
|           from: 'pages.localeCode', | ||||
|           to: 'locales.code' | ||||
|         } | ||||
|       } | ||||
|   | ||||
| @@ -23,13 +23,11 @@ module.exports = class User extends Model { | ||||
|         id: {type: 'integer'}, | ||||
|         email: {type: 'string', format: 'email'}, | ||||
|         name: {type: 'string', minLength: 1, maxLength: 255}, | ||||
|         provider: {type: 'string', minLength: 1, maxLength: 255}, | ||||
|         providerId: {type: 'number'}, | ||||
|         password: {type: 'string'}, | ||||
|         role: {type: 'string', enum: ['admin', 'guest', 'user']}, | ||||
|         tfaIsActive: {type: 'boolean', default: false}, | ||||
|         tfaSecret: {type: 'string'}, | ||||
|         locale: {type: 'string'}, | ||||
|         jobTitle: {type: 'string'}, | ||||
|         location: {type: 'string'}, | ||||
|         pictureUrl: {type: 'string'}, | ||||
| @@ -52,6 +50,30 @@ module.exports = class User extends Model { | ||||
|           }, | ||||
|           to: 'groups.id' | ||||
|         } | ||||
|       }, | ||||
|       provider: { | ||||
|         relation: Model.BelongsToOneRelation, | ||||
|         modelClass: require('./authentication'), | ||||
|         join: { | ||||
|           from: 'users.providerKey', | ||||
|           to: 'authentication.key' | ||||
|         } | ||||
|       }, | ||||
|       defaultEditor: { | ||||
|         relation: Model.BelongsToOneRelation, | ||||
|         modelClass: require('./editors'), | ||||
|         join: { | ||||
|           from: 'users.editorKey', | ||||
|           to: 'editors.key' | ||||
|         } | ||||
|       }, | ||||
|       locale: { | ||||
|         relation: Model.BelongsToOneRelation, | ||||
|         modelClass: require('./locales'), | ||||
|         join: { | ||||
|           from: 'users.localeCode', | ||||
|           to: 'locales.code' | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user