fog-controller
Version:
Fog Controller project @ iotracks.com
38 lines (25 loc) • 1.6 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _elementInputTypeManager = require('../managers/elementInputTypeManager');
var _elementInputTypeManager2 = _interopRequireDefault(_elementInputTypeManager);
var _appUtils = require('../utils/appUtils');
var _appUtils2 = _interopRequireDefault(_appUtils);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createElementInputType = function createElementInputType(props, params, callback) {
_elementInputTypeManager2.default.createElementInputType(props.elementInputType).then(_appUtils2.default.onCreate.bind(null, params, props.setProperty, 'Unable to create Element Input Type object.', callback));
};
var updateElementInputType = function updateElementInputType(props, params, callback) {
var elementKey = _appUtils2.default.getProperty(params, props.elementKey);
_elementInputTypeManager2.default.updateElementInputType(elementKey, props.updatedData).then(_appUtils2.default.onUpdate.bind(null, params, 'Unable to update Element Input Type object.', callback));
};
var deleteElementInputType = function deleteElementInputType(props, params, callback) {
var elementKey = _appUtils2.default.getProperty(params, props.elementKey);
_elementInputTypeManager2.default.deleteByElementKey(elementKey).then(_appUtils2.default.onDeleteOptional.bind(null, params, callback));
};
exports.default = {
createElementInputType: createElementInputType,
updateElementInputType: updateElementInputType,
deleteElementInputType: deleteElementInputType
};