<commit_before>var myApp = angular.module("ContactListApp", []);

myApp.controller('AppCtrl', ['$scope', '$http', function ($scope, $http) {
	var url;
	var checkUrl = function() {
		if($scope.req_url == undefined || $scope.req_url == "")
			url = "/contacts"
		else
			url = $scope.req_url
	}

	$scope.refresh = function() {
		checkUrl();
		$http.get(url).success(function (contacts) {
			$scope.contactlist = contacts;
		}).error(function (status, response) {
			$scope.contactlist = [{ name : "Cannot load data", email : "", number : ""}]
		});
	}

	$scope.refresh();

	$scope.addContact = function() {
		checkUrl();
		$http.post(url, $scope.contact).success(function(response){
			$scope.contact.name = null;
			$scope.contact.email = null;
			$scope.contact.number = null;
			$scope.refresh();
		});
	};

	$scope.deleteContact = function(oid, _id) {
		checkUrl();
		if(oid == undefined)
			$http.delete(url +_id).success(function (response) {
				$scope.refresh();
			});
		else
			$http.delete(url + '/contacts/'+oid).success(function (response) {
				$scope.refresh();
			});
	}
}]);<commit_msg>BUGFIX: Corregido controlador delete URL<commit_after>var myApp = angular.module("ContactListApp", []);

myApp.controller('AppCtrl', ['$scope', '$http', function ($scope, $http) {
	var url;
	var checkUrl = function() {
		if($scope.req_url == undefined || $scope.req_url == "")
			url = "/contacts"
		else
			url = $scope.req_url
	}

	$scope.refresh = function() {
		checkUrl();
		$http.get(url).success(function (contacts) {
			$scope.contactlist = contacts;
		}).error(function (status, response) {
			$scope.contactlist = [{ name : "Cannot load data", email : "", number : ""}]
		});
	}

	$scope.refresh();

	$scope.addContact = function() {
		checkUrl();
		$http.post(url, $scope.contact).success(function(response){
			$scope.contact.name = null;
			$scope.contact.email = null;
			$scope.contact.number = null;
			$scope.refresh();
		});
	};

	$scope.deleteContact = function(oid, _id) {
		checkUrl();
		if(oid == undefined)
			$http.delete(url +_id).success(function (response) {
				$scope.refresh();
			});
		else
			$http.delete(url + '/'+oid).success(function (response) {
				$scope.refresh();
			});
	}
}]);
{'fraction_non_alphanumeric': 0.2009009009009009, 'fraction_numerical': 0.0, 'mean_word_length': 3.892070484581498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4700468', 'n_tokens_mistral': 853, 'n_tokens_neox': 763, 'n_words': 140}