예제 #1
0
def dropMeal(meal_id):
	user_id = request.args.get('user_id')
	if not user_id:
		return jsonify({'status':'failed','error':'missing fields'})
	if not uv.loginStatus(user_id):
                return jsonify({'status':'failed','error':'user not logged in'})
	return jsonify(ml.Meals().delete(user_id,meal_id))
예제 #2
0
def alterMeals(meal_id):
	user_id = request.args.get('user_id')
	meal = request.args.get('meal')
	category = request.args.get('category')
	if not user_id or not meal or not category:
		return jsonify({'status':'failed','error':'missing fields'})
	if not uv.loginStatus(user_id):
                return jsonify({'status':'failed','error':'user not logged in'})
	return jsonify(ml.Meals().editMeal(user_id, meal_id, meal, category))
예제 #3
0
def userMeal(user_id, meal_id):
	if not uv.loginStatus(user_id):
                return jsonify({'status':'failed','error':'user not logged in'})
	return jsonify(ml.Meals().fetchMealsById(user_id, meal_id))
예제 #4
0
def getMeals():
	return jsonify(ml.Meals().fetchAllMeals())
예제 #5
0
def getWeekList(week):
	return jsonify(ml.Meals().foodListWeek(week))
예제 #6
0
def getMealList():
	return jsonify(ml.Meals().foodList())