Browse Source

:pencil2: Fixed merge conflicts

tags/0.0.4
tomit4 2 years ago
parent
commit
01fe3ccba4

+ 1
- 1
frontend/src/router/guards.js View File

@@ -51,6 +51,6 @@ const checkLoginStatus = async (destination, nextCb) => {
51 51
     } else {
52 52
         nextCb()
53 53
     }
54
-        }
54
+}
55 55
 
56 56
 export { checkLoginStatus }

+ 11
- 3
frontend/src/views/OnboardingView.vue View File

@@ -29,7 +29,11 @@ main.view--onboarding
29 29
             p(v-if='currentStep != 0') You have completed: {{ currentStep }} / {{ survey?.steps?.length }} survey steps
30 30
 
31 31
     article(v-else)
32
-        SurveyCompleteView(:answers='answered' :surveySteps='survey.steps' :responses='responses')
32
+        SurveyCompleteView(
33
+            :answers='answered'
34
+            :responses='responses'
35
+            :surveySteps='survey.steps'
36
+        )
33 37
 </template>
34 38
 
35 39
 <script>
@@ -53,10 +57,13 @@ export default {
53 57
         invalidResponse: false,
54 58
     }),
55 59
     async created() {
60
+        // TODO: Troubleshoot bug where not all responses are returned at SurveyCompleteView
61
+        console.log('currentProfile :=>', currentProfile)
56 62
         this.survey = await surveyFactory.createSurvey()
57 63
         try {
58
-            const sessionData =
59
-                await authenticator.verifySessionCookie('siimee_session')
64
+            const sessionData = await authenticator.verifySessionCookie(
65
+                'siimee_session',
66
+            )
60 67
             if (sessionData) {
61 68
                 this.responses = this.formatResponses(
62 69
                     currentProfile._profile.responses,
@@ -85,6 +92,7 @@ export default {
85 92
             })
86 93
         },
87 94
         async updateAnswers(payload) {
95
+            console.log('this.survey.steps :=>', this.survey.steps)
88 96
             if (payload) {
89 97
                 const k = payload.question.survey_stage
90 98
                 this.answered[k] = payload.input

+ 14
- 10
frontend/src/views/SurveyCompleteView.vue View File

@@ -112,20 +112,24 @@ export default {
112 112
     methods: {
113 113
         changeAnswers(){
114 114
             console.log('change answers')
115
-            
116 115
         },
117 116
 
118
-        async finalSubmit(){
117
+        async finalSubmit() {
119 118
             // separate user info from responses
120
-            const [user, survey] = this._separateUserInfoFromResponses(this.answers)
119
+            const [user, survey] = this._separateUserInfoFromResponses(
120
+                this.answers,
121
+            )
121 122
 
122 123
             // create user
123 124
             const createdUser = await signUpUser(user)
124 125
             if (!createdUser) return
125 126
 
126
-            // create profile 
127
-            const userProfile = await createProfileForUserId(createdUser.user_id, survey)
128
-            if(!userProfile) return
127
+            // create profile
128
+            const userProfile = await createProfileForUserId(
129
+                createdUser.user_id,
130
+                survey,
131
+            )
132
+            if (!userProfile) return
129 133
 
130 134
             this._setLoginForProfile(userProfile)
131 135
 
@@ -133,13 +137,13 @@ export default {
133 137
         },
134 138
 
135 139
         // TODO write logic to parse answers
136
-        _separateUserInfoFromResponses(answers){
137
-            return ['','']
140
+        _separateUserInfoFromResponses(answers) {
141
+            return ['', '']
138 142
         },
139 143
 
140
-        async _setLoginForProfile(profile){
144
+        async _setLoginForProfile(profile) {
141 145
             const currentId = currentProfile.login(profile.profile_id)
142
-            if(currentId && profile.responses.length){
146
+            if (currentId && profile.responses.length) {
143 147
                 currentProfile.setResponses(profile.responses)
144 148
             }
145 149
             if (!currentProfile.isComplete) {

Loading…
Cancel
Save