Skip to content

Commit

Permalink
Add Application Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishika Shivnani authored and Krishika Shivnani committed Nov 3, 2021
1 parent c37a26d commit 1bf3060
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Controller/application_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ def __init__(self):
self.headers = {'Content-Type': 'text/html'}
self.application = application_dao()

@login_required
# @login_required
def get(self):
return {'about':"hello!"}

@login_required
# @login_required
def post(self, email, company_name, location, job_profile, salary, username, password, security_question, security_answer, notes,
date_applied):
return self.application.add_application(email, company_name, location, job_profile, salary, username, password, security_question, security_answer, notes,
date_applied)

@login_required
# @login_required
def put(self):
some_json=request.get_json()
return {'you sent': some_json}, 201

@login_required
# @login_required
def delete(self):
some_json=request.get_json()
return {'you sent': some_json}, 201
7 changes: 4 additions & 3 deletions Controller/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def view():
card_selected = request.args.get('user')
return render_template('view_list.html', data=data, upcoming_events=upcoming_events)

@home_route.route("/add_new_application", methods = ["POST"])
@home_route.route("/add_new_application", methods = ["GET","POST"])
# @login_required
def add_new_application():
company_name = request.form["companyName"]
location = request.form["location"]
Expand All @@ -107,8 +108,8 @@ def add_new_application():
date_applied)
if (result==0):
error = "This job application could not be stored in the database. Please try again."
return render_template('home.html/add_new_application', jobAddError=error)
# return render_template('home.html', data=data, upcoming_events=upcoming_events)
return render_template('home.html', jobAddError=error)
return render_template('home.html', data=data, upcoming_events=upcoming_events)


@home_route.route('/logout', methods=['GET'])
Expand Down
3 changes: 3 additions & 0 deletions DAO/application_dao.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from DAO.sql_helper import sql_helper

class application_dao:
def __init__(self):
self.__db = sql_helper()

def add_application(self, email, company_name, location, job_profile, salary, username, password, security_question, security_answer, notes,
date_applied):
status = "TO_DO"
Expand Down

0 comments on commit 1bf3060

Please sign in to comment.