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.

RoomsBusiness.js 919B

12345678910111213141516171819202122232425262728293031
  1. (function()
  2. {
  3. angular.module('appSdk')
  4. .factory('RoomsBusiness', ['RoomsDataAccess', '$q', 'DataShareBusiness', function(RoomsDataAccess, $q, DataShareBusiness) {
  5. var Business = {};
  6. Business.getRootRooms = RoomsDataAccess.getRootRooms;
  7. Business.getFreeRooms = RoomsDataAccess.getFreeRooms;
  8. Business.getAll = function(promise)
  9. {
  10. var defer = $q.defer();
  11. RoomsDataAccess.getAll(promise).then(function(data)
  12. {
  13. data.forEach(function(group)
  14. {
  15. DataShareBusiness.makeParents(group, "Rooms");
  16. group.parent = null;
  17. });
  18. defer.resolve(data);
  19. }, defer.reject);
  20. return defer.promise;
  21. };
  22. return Business;
  23. }]);
  24. })();