<commit_before>(function() {

	'use strict';
	
	angular.module('openlmis.requisitions').config(config);

	config.$inject = ['$stateProvider'];
	function config($stateProvider) {

		$stateProvider.state('requisitions', {
			abstract: true,
			url: '/requisitions',
			template: '<div ui-view></div>'
		});

		$stateProvider.state('requisitions.requisition', {
			url: '^/requisition/:rnr',
			controller: 'RequisitionCtrl',
			templateUrl: 'requisitions/requisition.html',
			resolve: {
				requisition: function ($q, $stateParams, RequisitionFactory) {
				  var deferred = $q.defer();

				  RequisitionFactory.get($stateParams.rnr).$promise.then(function(response) {
				      deferred.resolve(response);
				    }, function(response) {
				      alert('Cannot find requisition with UUID: ' + $stateParams.rnr);
				      deferred.reject();
				  });

				  return deferred.promise;
				}
      		}
    	});
	}

})();<commit_msg>OLMIS-1128: Add redirecting when requisition id is not found<commit_after>(function() {

	'use strict';
	
	angular.module('openlmis.requisitions').config(config);

	config.$inject = ['$stateProvider'];
	function config($stateProvider) {

		$stateProvider.state('requisitions', {
			abstract: true,
			url: '/requisitions',
			template: '<div ui-view></div>'
		});

		$stateProvider.state('requisitions.requisition', {
			url: '^/requisition/:rnr',
			controller: 'RequisitionCtrl',
			templateUrl: 'requisitions/requisition.html',
			resolve: {
				requisition: function ($location, $q, $stateParams, RequisitionFactory) {
				  var deferred = $q.defer();

				  RequisitionFactory.get($stateParams.rnr).$promise.then(function(response) {
				      deferred.resolve(response);
				    }, function(response) {
				      deferred.reject();
				      return $location.url('/404');
				  });

				  return deferred.promise;
				}
      		}
    	});
	}

})();
{'fraction_non_alphanumeric': 0.16180371352785147, 'fraction_numerical': 0.003713527851458886, 'mean_word_length': 3.427230046948357, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2493910', 'n_tokens_mistral': 727, 'n_tokens_neox': 574, 'n_words': 93}