<commit_before>app.constant("FAVORITE_ENDPOINT", "php/apis/favorite/");
app.service("FavoriteService", function($http, FAVORITE_ENDPOINT) {

	function getUrl() {
		return(FAVORITE_ENDPOINT);
	}

	function getUrlForFavoriterId(favoriteeId) {
		return(getUrl() + favoriteeId);
	}

	function getUrlForFavoriteeId(favoriterId) {
		return(getUrl() + favoriterId);
	}

	/*I don't think we need this here. We're not calling an array of stuff*/
	/*this.all = function() {
		return($http.get(getUrl()));
	};*/

	this.fetchFavoriteByFavoriteeId = function(favoriteeId) {
		return($http.get(getUrl() + "?favoriteeId=" + favoriteeId));
	};

	this.fetchFavoriteByFavoriterId = function(favoriterId) {
		return($http.get(getUrl() + "?favoriterId=" + favoriterId));
	};

	this.fetchAllFavorites = function() {
		return($http.get(getUrl()));
	};

	this.create = function(favorite) {
		return($http.post(getUrl(), favorite));
	};

	/*TODO do we need destroy if we only unpost a favorite and not destroy? for both favoriter and favoritee*/
	this.destroy = function(favoriteeId) {
		return($http.delete(getUrlForFavoriteeId(favoriteeId)));
	};

	this.destroy = function(favoriterId) {
		return($http.delete(getUrlForFavoriterId(favoriterId)));
	};
});<commit_msg>used favoriter and favoritee in both create and destroy https://app.asana.com/0/161555263951762/170520114054348<commit_after>app.constant("FAVORITE_ENDPOINT", "php/apis/favorite/");
app.service("FavoriteService", function($http, FAVORITE_ENDPOINT) {

	function getUrl() {
		return(FAVORITE_ENDPOINT);
	}

	function getUrlForFavoriterId(favoriteeId) {
		return(getUrl() + favoriteeId);
	}

	function getUrlForFavoriteeId(favoriterId) {
		return(getUrl() + favoriterId);
	}

	/*I don't think we need this here. We're not calling an array of stuff*/
	/*this.all = function() {
		return($http.get(getUrl()));
	};*/

	this.fetchFavoriteById = function(favoriteeId) {
		return($http.get(getUrl() + "?favoriteeId=" + favoriteeId));
	};

	this.fetchFavoriteById = function(favoriterId) {
		return($http.get(getUrl() + "?favoriterId=" + favoriterId));
	};

	this.fetchAllFavorites = function() {
		return($http.get(getUrl()));
	};

	/*we're attempting to target the destroy between the favoritee and the favoriter*/
	this.create = function(favoriteeId, favoriterId) {
		return($http.post(getUrlforId(favoriteeId, favoriterId)));
	};

	/*we're attempting to target the destroy between the favoritee and the favoriter*/
	this.destroy = function(favoriteeId, favoriterId) {
		return($http.delete(getUrlforId(favoriteeId, favoriterId)));
	};


	/*comment this out*/
	/*this.destroy = function(favoriterId) {
		return($http.delete(getUrlForFavoriterId(favoriterId)));
	};*/
});
{'fraction_non_alphanumeric': 0.1536756557074252, 'fraction_numerical': 0.011451791651274473, 'mean_word_length': 5.588807785888078, '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': '522282', 'n_tokens_mistral': 1011, 'n_tokens_neox': 946, 'n_words': 170}