From cfc609063b96f1e9b6f25ae8d45d67618cb3e364 Mon Sep 17 00:00:00 2001 From: vantage-ola Date: Fri, 11 Oct 2024 07:52:45 +0100 Subject: [PATCH] fix: update app.py to fix tests --- app.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app.py b/app.py index d1578cf..c75a712 100644 --- a/app.py +++ b/app.py @@ -1,10 +1,9 @@ """ Flask Application """ - from flask import Flask, jsonify, request -#from models import Experience, Education, Skill, User -from utils import check_phone_number, correct_spelling, load_data +from models import Experience, Education, Skill, User +from utils import check_phone_number, correct_spelling, get_suggestion, load_data app = Flask(__name__) @@ -72,7 +71,7 @@ def experience(): if request.method == "GET": return jsonify( - {"experience": [exp.__dict__ for exp in data["experience"]]}) + {"experience": [exp for exp in data["experience"]]}) if request.method == "POST": new_experience = request.json @@ -97,7 +96,7 @@ def education(): """ if request.method == "GET": return jsonify( - {"education": [edu.__dict__ for edu in data["education"]]}) + {"education": [edu for edu in data["education"]]}) if request.method == "POST": new_education = request.json @@ -122,7 +121,7 @@ def skill(): """ if request.method == "GET": - return jsonify({"skills": [skill.__dict__ for skill in data["skill"]]}) + return jsonify({"skills": [skill for skill in data["skill"]]}) if request.method == "POST": new_skill = request.json