mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 03:39:29 +00:00
feat: start tickets and messages search
This commit is contained in:
@@ -28,7 +28,7 @@ class Message extends Sequelize.Model {
|
||||
}
|
||||
|
||||
static associate(models) {
|
||||
this.belongsTo(models.Ticket, { foreignKey: "ticketId" });
|
||||
this.belongsTo(models.Ticket, { foreignKey: "ticketId", as: "messages" });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class Ticket extends Sequelize.Model {
|
||||
static associate(models) {
|
||||
this.belongsTo(models.Contact, { foreignKey: "contactId", as: "contact" });
|
||||
this.belongsTo(models.User, { foreignKey: "userId", as: "user" });
|
||||
this.hasMany(models.Message, { foreignKey: "ticketId" });
|
||||
this.hasMany(models.Message, { foreignKey: "ticketId", as: "messages" });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user