Skip to content

Commit

Permalink
fix: update app.py to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vantage-ola committed Oct 11, 2024
1 parent 22a1f9c commit cfc6090
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
@@ -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__)


Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit cfc6090

Please sign in to comment.