You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Created by robin on 11/21/15.
  3. */
  4. (function () {
  5. 'use strict';
  6. angular.module('camotionSdk')
  7. .factory('HostsService', ['luticateRequest', function (luticateRequest) {
  8. var HostsService = {};
  9. HostsService.add = function(data, promise)
  10. {
  11. return luticateRequest.post("/api/hosts/add", {host: JSON.stringify(data)}, null, promise);
  12. };
  13. HostsService.getAll = function(data, promise)
  14. {
  15. return luticateRequest.get("/api/hosts", data, promise);
  16. };
  17. HostsService.get = function(data, promise)
  18. {
  19. return luticateRequest.get("/api/hosts/" + data.host_id , null, promise);
  20. };
  21. HostsService.edit = function(data, promise)
  22. {
  23. return luticateRequest.post("/api/hosts/" + data.host_id + "/edit", {host: JSON.stringify(data)}, null, promise);
  24. };
  25. HostsService.del = function(data, promise)
  26. {
  27. return luticateRequest.post("/api/hosts/" + data.host_id + "/del", null, null, promise);
  28. };
  29. return HostsService;
  30. }]);
  31. })();