diff --git a/src/App.vue b/src/App.vue index fa3f523..3f4ce79 100644 --- a/src/App.vue +++ b/src/App.vue @@ -117,13 +117,14 @@ let focus, blur, tokenRefresh mounted() { let getToken = (trig) => { console.log('token trigger', trig) - if (this.$firebase.currentUser) { + if (this.$firebase.auth().currentUser) { this.$firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then((idToken) => { this.$store.commit("token", idToken) - }) + } else { + } } diff --git a/src/views/Review.vue b/src/views/Review.vue index c3d9afe..eb27029 100644 --- a/src/views/Review.vue +++ b/src/views/Review.vue @@ -21,7 +21,8 @@
-
+

{{app.firstName}} {{app.lastName}}

{{app.application.school? app.application.school : app.application.company}}

{{app.role}}

@@ -56,31 +57,41 @@

Questions

Experience Attending Hackathons: {{focusedApp.application.expAttending}}

-

Experience Mentoring or Judging Hackathons: {{focusedApp.application.expMentoringJudging}}

-

Experience Working with High School Students: {{focusedApp.application.expWorkingWithStudents}}

+

Experience Mentoring or Judging Hackathons: {{focusedApp.application.expMentoringJudging}} +

+

Experience Working with High School Students: {{focusedApp.application.expWorkingWithStudents}} +

Areas of expertise: {{focusedApp.application.areasOfExpertise}}

-

Why do you want to attend?: {{focusedApp.application.whyDoYouWantToAttend}}

-

Experience with software development: {{focusedApp.application.experienceSoftware}}

-

Experience with hardware development: {{focusedApp.application.experienceHardware}}

-

Experience with hackathons: {{focusedApp.application.experienceHackathon}}

-

Experience with team coding: {{focusedApp.application.experienceTeamCoding}}

-

Description of computer science experience: {{focusedApp.application.descriptionCompSciExp}}

+

Why do you want to attend?: {{focusedApp.application.whyDoYouWantToAttend}} +

+

Experience with software development: + {{focusedApp.application.experienceSoftware}}

+

Experience with hardware development: + {{focusedApp.application.experienceHardware}}

+

Experience with hackathons: {{focusedApp.application.experienceHackathon}} +

+

Experience with team coding: {{focusedApp.application.experienceTeamCoding}} +

+

Description of computer science experience: {{focusedApp.application.descriptionCompSciExp}} +

Coming with team: {{focusedApp.application.team? "Yes" : "No"}}

Logistics

-

Laptop: {{focusedApp.application.laptop? "Yes" : "No"}}

+

Laptop: {{focusedApp.application.laptop? "Yes" : "No"}} +

Food Allergies: {{objList(focusedApp.application.foodAllergies)}}

-

Dietary Restrictions: {{objList(focusedApp.application.dietaryRestrictions)}}

+

Dietary Restrictions: {{objList(focusedApp.application.dietaryRestrictions)}} +

Accommodations: {{focusedApp.application.accommodations}}

Shirt Size: {{focusedApp.application.shirtSize}}

Referrers: {{objList(focusedApp.application.referrers)}}

Comments: {{focusedApp.application.comments}}

- +
@@ -109,11 +120,56 @@ } }, methods: { + accept(id) { + console.log("accpting", id) + + + fetch(this.$store.getters.api + "/api/v1/admin/applications/accept", { + method: "post", + headers: { + "Authorization": this.$store.getters.token, + "Content-Type": "application/json" + }, + body: JSON.stringify({applicationId: id}) + }).then(async res => { + let json = await res.json() + console.log(json, res.status) + if (json.success) { + fetch(this.$store.getters.api + "/api/v1/admin/applications", { + method: "get", + headers: { + "Authorization": this.$store.getters.token + } + }).then(async res => { + let json = await res.json() + console.log(json, res.status) + if (json.applicants) { + this.$store.commit("applications", json.applicants) + } else { + this.$swal("Error fetching applications") + } + }) + let person = this.focusedApp.firstName + this.chosen = false + + this.$swal({ + icon: "success", title: "Success", + text: `${person} has been accepted. They have automatically been sent an acceptance email.` + }) + + } else { + this.$swal({ + icon: "error", title: "ERROR", + text: `${this.focusedApp.firstName} has not been accepted. Please take a screen shot and email Ronan` + }) + } + }) + }, objList(obj) { let terms = [] Object.keys(obj).forEach(i => { if (i === "otherEnabled" && obj.otherEnabled) { - // console.log(obj.otherEnabled, obj.other) + // console.log(obj.otherEnabled, obj.other) terms.push(obj.other) } else { if (obj[i] && i != "other") {