<commit_before>var models = require('../models');

exports.newTarget = function(req, res) {
   
	console.log("EditIndivGoals linked!");
	models.Activity
		.update({"activity": req.query.activity}, {"goal": req.query.time})
		.exec(afterUpdating);
	function afterUpdating(err){
		res.send()
	}	

}

exports.getTarget = function(req, res) {
   
	console.log("EditIndivGoals linked!");
	models.Activity
		.find({"activity": req.query.activity})
		.exec(afterFinding);
	function afterFinding(err, activity){
		var result = { "activity": req.query.activity , "oldTarget": activity[0]['goal'], "newTarget": req.query.time} ;
		res.send(result)
	}	

}<commit_msg>Realized there was also the same problem w/ editing goals....fixed that one too<commit_after>var models = require('../models');

exports.newTarget = function(req, res) {
   
	console.log("EditIndivGoals linked!");
	models.Activity
		.update({"activity": req.query.activity, 'user': req.session.username}, {"goal": req.query.time})
		.exec(afterUpdating);
	function afterUpdating(err){
		res.send()
	}	

}

exports.getTarget = function(req, res) {
   
	console.log("EditIndivGoals linked!");
	models.Activity
		.find({"activity": req.query.activity, 'user': req.session.username})
		.exec(afterFinding);
	function afterFinding(err, activity){
		var result = { "activity": req.query.activity , "oldTarget": activity[0]['goal'], "newTarget": req.query.time} ;
		res.send(result)
	}	

}
{'fraction_non_alphanumeric': 0.17593880389429764, 'fraction_numerical': 0.0013908205841446453, 'mean_word_length': 4.80241935483871, 'pattern_counts': {'":': 12, '<': 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': '6516800', 'n_tokens_mistral': 499, 'n_tokens_neox': 475, 'n_words': 92}