fog-controller
Version:
Fog Controller project @ iotracks.com
38 lines (25 loc) • 1.62 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _elementOutputTypeManager = require('../managers/elementOutputTypeManager');
var _elementOutputTypeManager2 = _interopRequireDefault(_elementOutputTypeManager);
var _appUtils = require('../utils/appUtils');
var _appUtils2 = _interopRequireDefault(_appUtils);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createElementOutputType = function createElementOutputType(props, params, callback) {
_elementOutputTypeManager2.default.createElementOutputType(props.elementOutputType).then(_appUtils2.default.onCreate.bind(null, params, props.setProperty, 'Unable to create Element Output Type object.', callback));
};
var updateElementOutputType = function updateElementOutputType(props, params, callback) {
var elementKey = _appUtils2.default.getProperty(params, props.elementKey);
_elementOutputTypeManager2.default.updateElementOutputType(elementKey, props.updatedData).then(_appUtils2.default.onUpdate.bind(null, params, 'Unable to update Element Output Type object.', callback));
};
var deleteElementOutputType = function deleteElementOutputType(props, params, callback) {
var elementKey = _appUtils2.default.getProperty(params, props.elementKey);
_elementOutputTypeManager2.default.deleteByElementKey(elementKey).then(_appUtils2.default.onDeleteOptional.bind(null, params, callback));
};
exports.default = {
createElementOutputType: createElementOutputType,
updateElementOutputType: updateElementOutputType,
deleteElementOutputType: deleteElementOutputType
};