-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMPROVE] Replace livechat:departments
publication by REST Calls
#15478
Conversation
} | ||
} | ||
this.autorun(async () => { | ||
const { department, agents } = await APIClient.v1.get(`livechat/department/${ FlowRouter.getParam('_id') }`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is currently doing the request even without an _id
.. this request is only needed when editing a department
const room = LivechatRoom.findOne({ _id: rid }); | ||
this.visitorId.set(room && room.v && room.v._id); | ||
this.departmentId.set(room && room.departmentId); | ||
this.tags.set(room && room.tags); | ||
const { department } = await APIClient.v1.get(`livechat/department/${ this.departmentId.get() }`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is being called on every message sent (due to changes on room object).
I recommend moving this GET to a separate autorun
orbserving only this.departmentId
livechat:departments
publication by REST Calls
No description provided.