Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DrhDocumentFactory.getCategoryList(hierarchyPermission, drhPermission).then(function success(categoryList) {
- vm.categoryList = categoryList;
- angular.forEach(domainIdList, function (domainId) {
- domainId = parseInt(domainId);
- DrhDocumentFactory.getDocumentList(hierarchyId, vm.noeudId, domainId).then(function success(response) {
- domainIdCounter++;
- if (domainIdCounter === domainIdList.length) {
- $ionicLoading.hide();
- }
- if (response.success) {
- angular.forEach(vm.categoryList, function (category, categoryId) {
- angular.forEach(category.topDocList, function (categoryTopDoc) {
- angular.forEach(response.documentList, function (document) {
- if (categoryTopDoc.code === document.topDoc) {
- if (vm.owlItemsList[categoryId] === undefined) {
- vm.owlItemsList[categoryId] = [];
- }
- if (drhPermission === 'ALL') {
- if (categoryId === 'SANTE' || categoryId === 'PREVOYANCE') {
- if (categoryId === 'SANTE' && domainId === 11) {
- vm.owlItemsList[categoryId].push(document);
- } else if (categoryId === 'PREVOYANCE' && domainId === 12) {
- vm.owlItemsList[categoryId].push(document);
- }
- } else {
- vm.owlItemsList[categoryId].push(document);
- }
- } else {
- vm.owlItemsList[categoryId].push(document);
- }
- vm.noResult = false;
- }
- });
- });
- });
- } else {
- ErrorService.httpError(response.data);
- }
- vm.documentListIsLoaded = true;
- }, function error(response) {
- ErrorService.httpError(response.data);
- vm.documentListIsLoaded = true;
- $ionicLoading.hide();
- });
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement