Updated models to include roles

This commit is contained in:
Alexis
2020-12-30 21:52:06 +01:00
parent 0fd0253fb4
commit 3bdf43d11b
2 changed files with 14 additions and 2 deletions

View File

@@ -1,9 +1,14 @@
'use strict'
const bookshelf = require('../database/bookshelf').bookshelf
const bookshelf = require('../database/bookshelf').bookshelf;
require('./role-model');
let User = bookshelf.Model.extend({
tableName: 'user',
hidden: ['id', 'password']
hidden: [ 'password' ],
role() {
return this.belongsTo( 'Role' );
},
})
module.exports = bookshelf.model('User', User)