improvement: show username on ticket header

This commit is contained in:
canove
2020-07-29 10:14:38 -03:00
parent c76ac84a76
commit a36bd8f5a6
3 changed files with 7 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ class Ticket extends Sequelize.Model {
static associate(models) {
this.belongsTo(models.Contact, { foreignKey: "contactId", as: "contact" });
this.belongsTo(models.User, { foreignKey: "userId" });
this.belongsTo(models.User, { foreignKey: "userId", as: "user" });
this.hasMany(models.Message, { foreignKey: "ticketId" });
}
}