Merge branch 'dev'
This commit is contained in:
13
server/api/models/fed_users.js
Normal file
13
server/api/models/fed_users.js
Normal file
@@ -0,0 +1,13 @@
|
||||
module.exports = (sequelize, DataTypes) => {
|
||||
const fed_users = sequelize.define('fed_users', {
|
||||
ap_id: {
|
||||
type: DataTypes.STRING,
|
||||
primaryKey: true
|
||||
},
|
||||
object: DataTypes.JSON
|
||||
}, {})
|
||||
fed_users.associate = function(models) {
|
||||
// associations can be defined here
|
||||
};
|
||||
return fed_users
|
||||
}
|
||||
@@ -28,10 +28,6 @@ module.exports = (sequelize, DataTypes) => {
|
||||
is_admin: DataTypes.BOOLEAN,
|
||||
is_active: DataTypes.BOOLEAN,
|
||||
rsa: DataTypes.JSON,
|
||||
followers: {
|
||||
type: DataTypes.JSON,
|
||||
defaultValue: []
|
||||
}
|
||||
}, {
|
||||
scopes: {
|
||||
withoutPassword: {
|
||||
@@ -43,6 +39,7 @@ module.exports = (sequelize, DataTypes) => {
|
||||
user.associate = function (models) {
|
||||
// associations can be defined here
|
||||
user.hasMany(models.event)
|
||||
user.belongsToMany(models.fed_users, { through: 'user_followers', as: 'followers' })
|
||||
}
|
||||
|
||||
user.prototype.comparePassword = async function (pwd) {
|
||||
|
||||
Reference in New Issue
Block a user