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))
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))
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))
def getMeals(): return jsonify(ml.Meals().fetchAllMeals())
def getWeekList(week): return jsonify(ml.Meals().foodListWeek(week))
def getMealList(): return jsonify(ml.Meals().foodList())