UNPKG

amocrm-client

Version:
22 lines 875 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hasCustomFields = void 0; function hasCustomFields(Base) { return class HasCustomFields extends Base { cf(...args) { if (args.length === 0) return this.custom_fields_values; let custom_field = this.custom_fields_values.findWhere({ field_id: args[0] }); if (!custom_field && args.length == 1) return null; else if (!custom_field) custom_field = { field_id: args[0], values: [] }; if (args[1] != undefined) custom_field.values = args[1]; this.custom_fields_values.add([custom_field]); return custom_field; } }; } exports.hasCustomFields = hasCustomFields; //# sourceMappingURL=hasCustomFields.js.map