瀏覽代碼

:bug: Disabled new profile errors by adjusting mock

tags/0.0.4
tomit4 2 年之前
父節點
當前提交
2ba5346c11
共有 2 個文件被更改,包括 56 次插入19 次删除
  1. 44
    8
      backend/db/data-generator/mock.js
  2. 12
    11
      frontend/src/views/OnboardingView.vue

+ 44
- 8
backend/db/data-generator/mock.js 查看文件

@@ -425,6 +425,17 @@ module.exports = {
425 425
             tag_id: 7,
426 426
             is_deleted: false,
427 427
         },
428
+        // NOTE: profile_id 147 is chosen based off of GENERATED data,
429
+        // after running 'npm run generate', replace 147 in mock to next profile_id to be genearted
430
+        // i.e. last profile_id number + 1
431
+        // TODO: remove from mock data once bare bones matching logic can show poorly matched matches...
432
+        {
433
+            tag_association_id: 50,
434
+            profile_id: 136,
435
+            grouping_id: 2,
436
+            tag_id: 7,
437
+            is_deleted: false,
438
+        },
428 439
     ],
429 440
     response_keys: [
430 441
         {
@@ -671,6 +682,26 @@ module.exports = {
671 682
             can_edit: false,
672 683
             is_active: true,
673 684
         },
685
+        // NOTE: profile_id 147 is chosen based off of GENERATED data,
686
+        // after running 'npm run generate', replace 147 in mock to next profile_id to be genearted
687
+        // i.e. last profile_id number + 1
688
+        // TODO: remove from mock data once bare bones matching logic can show poorly matched matches...
689
+        {
690
+            membership_id: 3,
691
+            profile_id: 147,
692
+            grouping_id: 2,
693
+            membership_type: 'participant',
694
+            can_edit: false,
695
+            is_active: true,
696
+        },
697
+        {
698
+            membership_id: 4,
699
+            profile_id: 46,
700
+            grouping_id: 2,
701
+            membership_type: 'participant',
702
+            can_edit: false,
703
+            is_active: true,
704
+        },
674 705
     ],
675 706
     groupings: [
676 707
         {
@@ -678,6 +709,11 @@ module.exports = {
678 709
             grouping_name: '1663285820.067_41_46',
679 710
             grouping_type: 'match',
680 711
         },
712
+        {
713
+            grouping_id: 2,
714
+            grouping_name: '1663285820.067_147_46',
715
+            grouping_type: 'match',
716
+        },
681 717
     ],
682 718
     messages: [],
683 719
     match_queues: [
@@ -732,43 +768,43 @@ module.exports = {
732 768
             target_id: 46,
733 769
             is_deleted: false,
734 770
         },
735
-        // NOTE: profile_id 139 is chosen based off of GENERATED data,
736
-        // after running 'npm run generate', replace 139 in mock to next profile_id to be genearted
771
+        // NOTE: profile_id 147 is chosen based off of GENERATED data,
772
+        // after running 'npm run generate', replace 147 in mock to next profile_id to be generated
737 773
         // i.e. last profile_id number + 1
738 774
         // TODO: remove from mock data once bare bones matching logic can show poorly matched matches...
739 775
         {
740 776
             match_queue_id: 17,
741
-            profile_id: 139,
777
+            profile_id: 147,
742 778
             target_id: 46,
743 779
             is_deleted: false,
744 780
         },
745 781
         {
746 782
             match_queue_id: 18,
747
-            profile_id: 139,
783
+            profile_id: 147,
748 784
             target_id: 46,
749 785
             is_deleted: false,
750 786
         },
751 787
         {
752 788
             match_queue_id: 19,
753
-            profile_id: 139,
789
+            profile_id: 147,
754 790
             target_id: 44,
755 791
             is_deleted: false,
756 792
         },
757 793
         {
758 794
             match_queue_id: 20,
759
-            profile_id: 139,
795
+            profile_id: 147,
760 796
             target_id: 43,
761 797
             is_deleted: false,
762 798
         },
763 799
         {
764 800
             match_queue_id: 21,
765
-            profile_id: 139,
801
+            profile_id: 147,
766 802
             target_id: 42,
767 803
             is_deleted: false,
768 804
         },
769 805
         {
770 806
             match_queue_id: 22,
771
-            profile_id: 139,
807
+            profile_id: 147,
772 808
             target_id: 41,
773 809
             is_deleted: false,
774 810
         },

+ 12
- 11
frontend/src/views/OnboardingView.vue 查看文件

@@ -55,23 +55,24 @@ export default {
55 55
         invalidResponse: false,
56 56
     }),
57 57
     async created() {
58
-        // TODO: Troubleshoot bug where memberships are not returned from backend with 500 err
59 58
         // TODO: Troubleshoot bug where not all responses are returned at SurveyCompleteView
60 59
         console.log('currentProfile :=>', currentProfile)
61 60
         this.survey = await surveyFactory.createSurvey()
62 61
         hashedAccessToken = this.grabStoredCookie('siimee_access')
63 62
         try {
64 63
             const sessionData = await this.verifySession(hashedAccessToken)
65
-            await currentProfile.login(
66
-                sessionData.profileId,
67
-                this.$waveui.notify,
68
-                sessionData.accessToken,
69
-            )
70
-            this.responses = this.formatResponses(
71
-                currentProfile._profile.responses,
72
-            )
73
-            this.currentStep = this.responses.length + 3
74
-            this.goToStep(this.currentStep)
64
+            if (sessionData) {
65
+                await currentProfile.login(
66
+                    sessionData.profileId,
67
+                    this.$waveui.notify,
68
+                    sessionData.accessToken,
69
+                )
70
+                this.responses = this.formatResponses(
71
+                    currentProfile._profile.responses,
72
+                )
73
+                this.currentStep = this.responses.length + 3
74
+                this.goToStep(this.currentStep)
75
+            }
75 76
         } catch (err) {
76 77
             console.error('ERROR :=>', err)
77 78
             this.goToStep(0)

Loading…
取消
儲存