Skip to content

Commit

Permalink
update: responses
Browse files Browse the repository at this point in the history
  • Loading branch information
MoWafy001 committed Jun 22, 2024
1 parent 9c820fb commit 6095567
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def fitness_predict():
return jsonify({"error": f"{paramName} is missing"}), 400
params[paramName] = value

return jsonify({"result": fitness_model.predict(**params)})
res = fitness_model.predict(**params)
return jsonify(res)


@app.post("/nutrition")
Expand All @@ -53,7 +54,8 @@ def nutrition_predict():
if value is None:
return jsonify({"error": f"{paramName} is missing"}), 400
params[paramName] = value
return jsonify({"result": nutrition_model.generate_plan(**params)})

return jsonify(nutrition_model.generate_plan(**params))


if __name__ == "__main__":
Expand Down

0 comments on commit 6095567

Please sign in to comment.