12345678910111213141516171819202122232425262728293031 |
- (function()
- {
- angular.module('appSdk')
- .factory('RoomsBusiness', ['RoomsDataAccess', '$q', 'DataShareBusiness', function(RoomsDataAccess, $q, DataShareBusiness) {
-
- var Business = {};
-
- Business.getRootRooms = RoomsDataAccess.getRootRooms;
-
- Business.getFreeRooms = RoomsDataAccess.getFreeRooms;
-
- Business.getAll = function(promise)
- {
- var defer = $q.defer();
-
- RoomsDataAccess.getAll(promise).then(function(data)
- {
- data.forEach(function(group)
- {
- DataShareBusiness.makeParents(group, "Rooms");
- group.parent = null;
- });
- defer.resolve(data);
- }, defer.reject);
-
- return defer.promise;
- };
-
- return Business;
- }]);
- })();
|