Skip to content
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

[NEW] Allow to send Agent custom fields through the Omnichannel CRM integration #16286

Merged
Prev Previous commit
Next Next commit
Fix eslint alerts.
  • Loading branch information
renatobecker committed Jan 19, 2020
commit b5beee9ff04a1aaf284561947d3d1a76676d06f2
6 changes: 3 additions & 3 deletions app/livechat/server/lib/Livechat.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,8 @@ export const Livechat = {
try {
const customFields = JSON.parse(settings.get('Accounts_CustomFields'));
return Object.keys(customFields)
.filter((customFieldKey) => customFields[customFieldKey].allowExternalSharing === true)
.map((field) => field);
.filter((customFieldKey) => customFields[customFieldKey].allowExternalSharing === true)
.map((field) => field);
} catch (error) {
return [];
}
Expand Down Expand Up @@ -643,7 +643,7 @@ export const Livechat = {
if (agent) {
const { customFields: agentCustomFields } = agent;
const externalCF = externalCustomFields();
const customFields = Object.keys(agentCustomFields).reduce((newObj, key) => externalCF.includes(key) ? { ...newObj, [key]: agentCustomFields[key]} : newObj, null);
const customFields = Object.keys(agentCustomFields).reduce((newObj, key) => (externalCF.includes(key) ? { ...newObj, [key]: agentCustomFields[key] } : newObj), null);

postData.agent = {
_id: agent._id,
Expand Down