瀏覽代碼

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

tags/0.0.3^2
tomit4 3 年之前
父節點
當前提交
230eb6a574

+ 2
- 1
backend/lib/routes/profile/insert.js 查看文件

49
 
49
 
50
             try {
50
             try {
51
                 // TODO: Currently passwords are stored in plain text, big no no...
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
                 if (!insertedResponse) {
55
                 if (!insertedResponse) {
55
                     throw new Error('Response not inserted')
56
                     throw new Error('Response not inserted')

+ 4
- 1
backend/lib/routes/user/signup.js 查看文件

30
     error: errorSchema.single,
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
 module.exports = {
36
 module.exports = {
34
     method: 'POST',
37
     method: 'POST',
35
     path: '/signup',
38
     path: '/signup',
56
                         is_admin: 0,
59
                         is_admin: 0,
57
                         is_verified: 0,
60
                         is_verified: 0,
58
                     },
61
                     },
59
-                    created_at: Date.now()
62
+                    created_at: Date.now(),
60
                 })
63
                 })
61
                 return h
64
                 return h
62
                     .response({
65
                     .response({

+ 17
- 1
frontend/src/components/onboarding/Splash.vue 查看文件

5
         :src='`/assets/logos/siimee_logo.jpg`'
5
         :src='`/assets/logos/siimee_logo.jpg`'
6
         :width='300'
6
         :width='300'
7
     )
7
     )
8
+
8
     w-button.ma1.grow.next-btn(
9
     w-button.ma1.grow.next-btn(
9
         :height='50'
10
         :height='50'
10
         :width='315'
11
         :width='315'
13
         shadow
14
         shadow
14
         text
15
         text
15
         xl
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
 </template>
27
 </template>
18
 
28
 
19
 <script>
29
 <script>
30
+
20
 export default {
31
 export default {
21
     name: 'Splash',
32
     name: 'Splash',
22
     props: {
33
     props: {
31
         handleSubmit() {
42
         handleSubmit() {
32
             this.$emit('update-answers', null)
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
 </script>
52
 </script>

+ 8
- 13
frontend/src/services/survey.service.js 查看文件

23
 }
23
 }
24
 
24
 
25
 const insertNewSurveyResponse = async (surveyResponse, profileId) => {
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
 const updateSurveyByProfileId = async (surveyResponses, profileId) => {
36
 const updateSurveyByProfileId = async (surveyResponses, profileId) => {
41
     surveyResponses.forEach(responseKeyIdwithVal => {
37
     surveyResponses.forEach(responseKeyIdwithVal => {
42
         const keyId = responseKeyIdwithVal.response_key_id
38
         const keyId = responseKeyIdwithVal.response_key_id
53
     })
49
     })
54
 }
50
 }
55
 
51
 
56
-// and similar to this
57
 const scoreSurveyByProfileId = async (profileId, maxDistance = 99) => {
52
 const scoreSurveyByProfileId = async (profileId, maxDistance = 99) => {
58
     const scoreSurvey = await db.get(
53
     const scoreSurvey = await db.get(
59
         `/profile/${profileId}/score?max_distance=${maxDistance}`,
54
         `/profile/${profileId}/score?max_distance=${maxDistance}`,

+ 2
- 2
frontend/src/utils/lang.js 查看文件

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

+ 7
- 1
frontend/src/views/LoginView.vue 查看文件

7
             w-input(label="Password" type="password" tile outline inner-icon-left='icon-eye')
7
             w-input(label="Password" type="password" tile outline inner-icon-left='icon-eye')
8
 
8
 
9
             //- Emit up an event so we can sync App pid with currentProfile.id
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
 </template>
12
 </template>
12
 
13
 
13
 <script>
14
 <script>
17
             profileId: null,
18
             profileId: null,
18
         },
19
         },
19
     }),
20
     }),
21
+    methods: {
22
+        something() {
23
+            console.log('something :=>')
24
+        }
25
+    }
20
 }
26
 }
21
 </script>
27
 </script>

Loading…
取消
儲存