Chatwoot/app/javascript/dashboard/helper/automationHelper.js
2022-05-13 15:52:17 +05:30

16 lines
395 B
JavaScript

export const getCustomAttributeInputType = key => {
const customAttributeMap = {
date: 'date',
text: 'plain_text',
list: 'search_select',
checkbox: 'search_select',
};
return customAttributeMap[key] || 'plain_text';
};
export const isACustomAttribute = (customAttributes, key) => {
return customAttributes.find(attr => {
return attr.attribute_key === key;
});
};