/** * Created by robin on 11/21/15. */ (function () { 'use strict'; angular.module('camotionAdmin') .factory('SensorsService', ['luticateRequest', function (luticateRequest) { var SensorsService = {}; SensorsService.add = function(data, promise) { return luticateRequest.post("/api/sensors/add", {sensor: JSON.stringify(data)}, null, promise); }; SensorsService.getAll = function(data, promise) { return luticateRequest.get("/api/sensors", data, promise); }; SensorsService.getAllTypes = function(promise) { return luticateRequest.get("/api/sensors/types", null, promise); }; SensorsService.get = function(data, promise) { return luticateRequest.get("/api/sensors/" + data.sensor_id , null, promise); }; SensorsService.edit = function(data, promise) { return luticateRequest.post("/api/sensors/" + data.sensor_id + "/edit", {sensor: JSON.stringify(data)}, null, promise); }; SensorsService.del = function(data, promise) { return luticateRequest.post("/api/sensors/" + data.sensor_id + "/del", null, null, promise); }; return SensorsService; }]); })();