Skip to content

Commit

Permalink
Replace regular function callback with arrow function.
Browse files Browse the repository at this point in the history
  • Loading branch information
renatobecker committed Apr 9, 2019
1 parent 7447fd1 commit f01c1aa
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app/models/server/models/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,13 @@ export class Users extends Base {
}

closeOffice() {
const self = this;
self.findAgents().forEach(function(agent) {
self.setLivechatStatus(agent._id, 'not-available');
});
const agents = this.findAgents();
agents && agents.map((agent) => this.setLivechatStatus(agent._id, 'not-available'));
}

openOffice() {
const self = this;
self.findAgents().forEach(function(agent) {
self.setLivechatStatus(agent._id, 'available');
});
const agents = this.findAgents();
agents && agents.map((agent) => this.setLivechatStatus(agent._id, 'available'));
}

getAgentInfo(agentId) {
Expand Down

0 comments on commit f01c1aa

Please sign in to comment.