diff --git a/app/models/server/models/Users.js b/app/models/server/models/Users.js index 2547943d6d32..14c86ee35bbe 100644 --- a/app/models/server/models/Users.js +++ b/app/models/server/models/Users.js @@ -185,17 +185,11 @@ export class Users extends Base { } closeOffice() { - self = this; - self.findAgents().forEach(function(agent) { - self.setLivechatStatus(agent._id, 'not-available'); - }); + this.findAgents().forEach((agent) => this.setLivechatStatus(agent._id, 'not-available')); } openOffice() { - self = this; - self.findAgents().forEach(function(agent) { - self.setLivechatStatus(agent._id, 'available'); - }); + this.findAgents().forEach((agent) => this.setLivechatStatus(agent._id, 'available')); } getAgentInfo(agentId) {