Browse Source

:construction: Setting up for transactional email, very much WIP

tags/0.0.3^2
tomit4 3 years ago
parent
commit
230eb6a574

+ 2
- 1
backend/lib/routes/profile/insert.js View File

@@ -49,7 +49,8 @@ module.exports = {
49 49
 
50 50
             try {
51 51
                 // TODO: Currently passwords are stored in plain text, big no no...
52
-                const insertedResponse = await profileService.insertSingleResponseForProfile(res)
52
+                const insertedResponse =
53
+                    await profileService.insertSingleResponseForProfile(res)
53 54
 
54 55
                 if (!insertedResponse) {
55 56
                     throw new Error('Response not inserted')

+ 4
- 1
backend/lib/routes/user/signup.js View File

@@ -30,6 +30,9 @@ const responseSchemas = {
30 30
     error: errorSchema.single,
31 31
 }
32 32
 
33
+// Brevo logic will go here,
34
+// send Brevo email with link that has jwt in it?
35
+
33 36
 module.exports = {
34 37
     method: 'POST',
35 38
     path: '/signup',
@@ -56,7 +59,7 @@ module.exports = {
56 59
                         is_admin: 0,
57 60
                         is_verified: 0,
58 61
                     },
59
-                    created_at: Date.now()
62
+                    created_at: Date.now(),
60 63
                 })
61 64
                 return h
62 65
                     .response({

+ 17
- 1
frontend/src/components/onboarding/Splash.vue View File

@@ -5,6 +5,7 @@ w-flex.column
5 5
         :src='`/assets/logos/siimee_logo.jpg`'
6 6
         :width='300'
7 7
     )
8
+
8 9
     w-button.ma1.grow.next-btn(
9 10
         :height='50'
10 11
         :width='315'
@@ -13,10 +14,20 @@ w-flex.column
13 14
         shadow
14 15
         text
15 16
         xl
16
-    ) GET STARTED
17
+    ) SIGN UP
18
+    router-link(to="/login")
19
+        w-button.ma1.grow.next-btn(
20
+            :height='50'
21
+            :width='315'
22
+            bg-color='success'
23
+            shadow
24
+            text
25
+            xl
26
+        ) LOG IN
17 27
 </template>
18 28
 
19 29
 <script>
30
+
20 31
 export default {
21 32
     name: 'Splash',
22 33
     props: {
@@ -31,6 +42,11 @@ export default {
31 42
         handleSubmit() {
32 43
             this.$emit('update-answers', null)
33 44
         },
45
+        handleLogin() {
46
+            console.log('hello world :=>')
47
+            // this.$emit('update-answers', null)
48
+        },
49
+
34 50
     },
35 51
 }
36 52
 </script>

+ 8
- 13
frontend/src/services/survey.service.js View File

@@ -23,20 +23,16 @@ const fetchQuestions = async () => {
23 23
 }
24 24
 
25 25
 const insertNewSurveyResponse = async (surveyResponse, profileId) => {
26
-        const keyId = surveyResponse.response_key_id
27
-        const val = surveyResponse.val
28
-        // POST
29
-        // TODO: create this route on the backend
30
-        db.post(`/profile/${profileId}/insert/${keyId}`,
31
-            {
32
-                profile_id: profileId,
33
-                response_key_id: keyId,
34
-                val: val,
35
-            }
36
-        )
26
+    const keyId = surveyResponse.response_key_id
27
+    const val = surveyResponse.val
28
+    // POST
29
+    db.post(`/profile/${profileId}/insert/${keyId}`, {
30
+        profile_id: profileId,
31
+        response_key_id: keyId,
32
+        val: val,
33
+    })
37 34
 }
38 35
 
39
-// similar to this
40 36
 const updateSurveyByProfileId = async (surveyResponses, profileId) => {
41 37
     surveyResponses.forEach(responseKeyIdwithVal => {
42 38
         const keyId = responseKeyIdwithVal.response_key_id
@@ -53,7 +49,6 @@ const updateSurveyByProfileId = async (surveyResponses, profileId) => {
53 49
     })
54 50
 }
55 51
 
56
-// and similar to this
57 52
 const scoreSurveyByProfileId = async (profileId, maxDistance = 99) => {
58 53
     const scoreSurvey = await db.get(
59 54
         `/profile/${profileId}/score?max_distance=${maxDistance}`,

+ 2
- 2
frontend/src/utils/lang.js View File

@@ -18,13 +18,13 @@ const splash = {
18 18
 // Easily reorder steps of survey here:
19 19
 const allSteps = {
20 20
     usa: {
21
-        name: 'name',
22 21
         email: 'email',
22
+        password: 'password',
23
+        name: 'name',
23 24
         seeking: 'seeking',
24 25
         aspect01: 'aspect-1',
25 26
         aspect02: 'aspect-2',
26 27
         aspect03: 'aspect-3',
27
-        password: 'password',
28 28
         zipcode: 'zipcode',
29 29
         urgency: 'urgency',
30 30
         aspect04: 'aspect-4',

+ 7
- 1
frontend/src/views/LoginView.vue View File

@@ -7,7 +7,8 @@ main.view--login
7 7
             w-input(label="Password" type="password" tile outline inner-icon-left='icon-eye')
8 8
 
9 9
             //- Emit up an event so we can sync App pid with currentProfile.id
10
-            w-button.xs12.mt12(@click="$emit('updatePid', form.profileId)" type="submit") submit
10
+            // w-button.xs12.mt12(@click="$emit('updatePid', form.profileId)" type="submit") submit
11
+            w-button.xs12.mt12(@click="something()") submit
11 12
 </template>
12 13
 
13 14
 <script>
@@ -17,5 +18,10 @@ export default {
17 18
             profileId: null,
18 19
         },
19 20
     }),
21
+    methods: {
22
+        something() {
23
+            console.log('something :=>')
24
+        }
25
+    }
20 26
 }
21 27
 </script>

Loading…
Cancel
Save