Handle enums with alias labels in a smart action
Handle enums with alias labels in a smart action
Implementation
exports.statusValueMatching = {
rejected: 'rejeté',
live: 'validé',
};
function getKeyByValue(object, value) {
return Object.keys(object).find((key) => object[key] === value);
}
exports.convertStatusValue = (status, source) => {
if (source === 'database') {
return this.statusValueMatching[status];
}
return getKeyByValue(this.statusValueMatching, status);
};PreviousCreate a record with a multiselect through a many-to-many relationshipNextDropdown with list of values in smart action form
Last updated
Was this helpful?