feat: core improvements + local fs provider + UI fixes
This commit is contained in:
34
server/models/locales.js
Normal file
34
server/models/locales.js
Normal file
@@ -0,0 +1,34 @@
|
||||
const Model = require('objection').Model
|
||||
|
||||
/**
|
||||
* Locales model
|
||||
*/
|
||||
module.exports = class User extends Model {
|
||||
static get tableName() { return 'locales' }
|
||||
|
||||
static get jsonSchema () {
|
||||
return {
|
||||
type: 'object',
|
||||
required: ['code', 'name'],
|
||||
|
||||
properties: {
|
||||
id: {type: 'integer'},
|
||||
code: {type: 'string'},
|
||||
strings: {type: 'object'},
|
||||
isRTL: {type: 'boolean', default: false},
|
||||
name: {type: 'string'},
|
||||
nativeName: {type: 'string'},
|
||||
createdAt: {type: 'string'},
|
||||
updatedAt: {type: 'string'}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$beforeUpdate() {
|
||||
this.updatedAt = new Date().toISOString()
|
||||
}
|
||||
$beforeInsert() {
|
||||
this.createdAt = new Date().toISOString()
|
||||
this.updatedAt = new Date().toISOString()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user