Skip to content

Commit 860b50f

Browse files
committed
test skills
1 parent 74e0511 commit 860b50f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

conditional/blueprints/major_project_submission.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,13 @@ def submit_major_project(user_dict=None):
9393
name = post_data['projectName']
9494
tldr = post_data['projectTldr']
9595
time_spent = post_data['projectTimeSpent']
96+
skills = post_data['projectSkills']
9697
description = post_data['projectDescription']
9798

9899
user_id = user_dict['username']
99100

101+
print(skills)
102+
100103
if name == "" or len(description.strip().split()) < 50: # check for 50 word minimum
101104
return jsonify({"success": False}), 400
102105
project = MajorProject(user_id, name, tldr, time_spent, description)

frontend/javascript/modules/majorProjectForm.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,18 @@ export default class MajorProjectForm {
5050
_submitForm(e) {
5151
e.preventDefault();
5252

53+
let skills = [];
54+
55+
for (const skill in document.getElementsByClassName('span[class=skill-tag]')) {
56+
skills.push(skill.innerText)
57+
}
58+
5359
let payload = {
5460
projectName: this.form.querySelector('input[name=name]').value,
5561
projectTldr: this.form.querySelector('input[name=tldr]').value,
5662
projectTimeSpent: this.form.querySelector('textarea[name=time-commitment]').value,
57-
projectDescription:
58-
this.form.querySelector('textarea[name=description]').value
63+
projectSkills: skills,
64+
projectDescription: this.form.querySelector('textarea[name=description]').value
5965
};
6066

6167
FetchUtil.postWithWarning(this.endpoint, payload, {

0 commit comments

Comments
 (0)