/**
 * Created by robin on 11/21/15.
 */
(function () {
    'use strict';

    angular.module('camotionSdk')
        .factory('HostsService', ['luticateRequest', function (luticateRequest) {

            var HostsService = {};

            HostsService.add = function(data, promise)
            {
                return luticateRequest.post("/api/hosts/add", {host: JSON.stringify(data)}, null, promise);
            };

            HostsService.getAll = function(data, promise)
            {
                return luticateRequest.get("/api/hosts", data, promise);
            };

            HostsService.get = function(data, promise)
            {
                return luticateRequest.get("/api/hosts/" + data.host_id , null, promise);
            };

            HostsService.edit = function(data, promise)
            {
                return luticateRequest.post("/api/hosts/" + data.host_id + "/edit", {host: JSON.stringify(data)}, null, promise);
            };

            HostsService.del = function(data, promise)
            {
                return luticateRequest.post("/api/hosts/" + data.host_id + "/del", null, null, promise);
            };

            return HostsService;
        }]);
})();