Skip to content

Commit

Permalink
Merge pull request #32 from ZeyadTarekk/delete-education
Browse files Browse the repository at this point in the history
feat: Implement API route to delete education
  • Loading branch information
varshar4 authored Jul 1, 2024
2 parents 285441e + 30b92c3 commit 0cb740f
Show file tree
Hide file tree
Showing 5 changed files with 1,327 additions and 2 deletions.
30 changes: 28 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
'''
from spellchecker import SpellChecker
from flask import Flask, jsonify, request, abort, Response
from models import Experience, Education, Skill
from models import Experience, Education, Skill, PersonalInfo
from helpers.education_api import *
from helpers.personal_info_api import *

app = Flask(__name__)
spell = SpellChecker(distance=2)
Expand All @@ -30,7 +31,9 @@
Skill("Python",
"1-2 Years",
"example-logo.png")
]
],
"pesronal_info": PersonalInfo("Zeyad Tarek","[email protected]","+201111111111")

}


Expand Down Expand Up @@ -105,6 +108,29 @@ def education():
new_education_data = request.json
data, response = handle_education_put_request(data, new_education_data, index)
return response
if request.method == 'DELETE':
index = request.args.get("id")
data, response = handle_education_delete_request(data, index)
return response

return jsonify({})

# To Get, Add, and update personal info
@app.route('/resume/personal-info/', methods=['GET', 'POST', 'PUT'])
def personal_info():
'''
Handles personal info requests
'''
if request.method == 'GET':
return get_personal_data(data)
if request.method == 'POST':
new_personal_data = request.json
data, response = add_personal_data(data, new_personal_data)
return response
if request.method == 'PUT':
updated_personal_data = request.json
data, response = update_personal_data(data, updated_personal_data)
return response

return jsonify({})

Expand Down
Loading

0 comments on commit 0cb740f

Please sign in to comment.