<commit_before>
app.controller ("Trail-Controller", ["$scope", "$uiModal", "TrailService", function($scope, $uibModal, TrailService) {
	// get the trail from the api
	// come back to add other
	// make doc blocks way better

	$scope.getTrailId = function(trailId, validated) {
		if(validated === true) {
			TrailService.fetchId(trailId)
				.then(function(result) {
					if(result.data.status === 200) {
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};
	$scope.getTrailUser = function(userId, validated) {
		if (validated === true) {
			TrailService.fetchUserId(userId)
				.then(function(result){
					if(result.data.status === 200){
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};
	$scope.getSubmitId = function(TrailSubmitId, validated) {
		if (validated === true) {
			TrailService.fetchSubmitId(TrailSubmitId)
				.then(function(result){
					if(result.data.status === 200) {
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};

	$scope.getTrailDifficulty = function(trailDifficulty, validated) {
		if (validated === true) {
			TrailService.fetchDifficulty(trailDifficulty)
				.then(function(result) {
					if(result.data.status === 200) {
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};
	$scope.getTrailDistance = function(trailDistance, validated) {
		if (validated === true) {
			TrailService.fetchDistance(trailDistance)
				.then(function(result) {
					if(result.data.status === 200) {
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};

	$scope.getTrailName = function(TrailName, validated) {
		if (validated === true) {
			TrailService.fetchName(TrailName)
				.then(function(result){
					if(result.data.status === 200) {
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};

	$scope.getTrailSubmission = function(trailSubmissionType, validated) {
		if (validated === true) {
			TrailService.fetchSubmission(trailSubmissionType)
				.then(function(result) {
					if(result.data.status === 200){
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};

	$scope





}]);<commit_msg>have added create and update need to figure what i need to use for scope https://app.asana.com/0/61036105436346/69245087519159<commit_after>
app.controller ("Trail-Controller", ["$scope", "$uiModal", "TrailService", function($scope, $uibModal, TrailService) {
	// get the trail from the api
	// come back to add other
	// make doc blocks way better
	$scope.trails = [];



	$scope.getTrailId = function(trailId, validated) {
		if(validated === true) {
			TrailService.fetchId(trailId)
				.then(function(result) {
					if(result.data.status === 200) {
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};
	$scope.getTrailUser = function(userId, validated) {
		if (validated === true) {
			TrailService.fetchUserId(userId)
				.then(function(result){
					if(result.data.status === 200){
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};
	$scope.getSubmitId = function(TrailSubmitId, validated) {
		if (validated === true) {
			TrailService.fetchSubmitId(TrailSubmitId)
				.then(function(result){
					if(result.data.status === 200) {
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};

	$scope.getTrailDifficulty = function(trailDifficulty, validated) {
		if (validated === true) {
			TrailService.fetchDifficulty(trailDifficulty)
				.then(function(result) {
					if(result.data.status === 200) {
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};
	$scope.getTrailDistance = function(trailDistance, validated) {
		if (validated === true) {
			TrailService.fetchDistance(trailDistance)
				.then(function(result) {
					if(result.data.status === 200) {
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};

	$scope.getTrailName = function(TrailName, validated) {
		if (validated === true) {
			TrailService.fetchName(TrailName)
				.then(function(result){
					if(result.data.status === 200) {
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};

	$scope.getTrailSubmission = function(trailSubmissionType, validated) {
		if (validated === true) {
			TrailService.fetchSubmission(trailSubmissionType)
				.then(function(result) {
					if(result.data.status === 200){
						$scope.trails = result.data.data
					} else {
						$scope.alerts[0] = {type: "danger", msg: result.data.message}
					}
				});
		}
	};

	$scope.createTrail = function(trail, validated) {
		if(validated === true) {
			// do i need to add the date
			TrailService.createTrail(trail)
				.then(function(result) {
					$scope.displayStatus(result.data);
				});
		}
	};

	$scope.updateTrail = function(trail, validated) {
		if(validated === true) {
			// do i need to add date.
			TrailService.update(trail.trailId, trail)
				.then(function(result){
					$scope.displayStatus(result.data);
					$scope.cancelEditing();
					$scope.getTrails();
				});
		}
	};








}]);
{'fraction_non_alphanumeric': 0.16347124117053483, 'fraction_numerical': 0.014295324587958291, 'mean_word_length': 3.010114632501686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '4037815', 'n_tokens_mistral': 2675, 'n_tokens_neox': 2080, 'n_words': 349}