Procházet zdrojové kódy

added queue services to index export, commented out code dependent on Queue entity

tags/0.0.1
diaseu před 4 roky
rodič
revize
e7c9d0d347

+ 1
- 0
frontend/src/services/index.js Zobrazit soubor

@@ -1,3 +1,4 @@
1 1
 export * from './profile.service'
2 2
 export * from './grouping.service'
3 3
 export * from './survey.service'
4
+export * from './queue.service'

+ 2
- 2
frontend/src/services/queue.service.js Zobrazit soubor

@@ -8,8 +8,8 @@ const fetchQueueByProfileId = async profileId => {
8 8
     const profilelist = []
9 9
 
10 10
     // WIP
11
-    const myMatchQueue = new Queue(profilelist)
12
-    return myMatchQueue
11
+    // const myMatchQueue = new Queue(profilelist)
12
+    // return myMatchQueue
13 13
 }
14 14
 
15 15
 const saveQueueByProfileId = async (targetId, profileId) => {

+ 25
- 19
frontend/src/services/survey.service.js Zobrazit soubor

@@ -10,7 +10,7 @@ import { Survey } from '../entities/survey'
10 10
  */
11 11
 const fetchSurveyByProfileId = async profileId => {
12 12
     const myquestions = await db.get(`/survey/questions`)
13
-    const allsteps = { }
13
+    const allsteps = {}
14 14
     const questionsPerStep = 3
15 15
     const stepsNeeded = Math.ceil(myquestions.length / questionsPerStep)
16 16
 
@@ -32,7 +32,7 @@ const fetchSurveyByProfileId = async profileId => {
32 32
             category: question.response_key_category,
33 33
         }
34 34
         for (let n = 1; n <= stepsNeeded; n++) {
35
-            if (i >=questionsPerStep*(n-1) && i < questionsPerStep*n) {
35
+            if (i >= questionsPerStep * (n - 1) && i < questionsPerStep * n) {
36 36
                 allsteps[`step-${n}`].push(reformatted)
37 37
             }
38 38
         }
@@ -43,34 +43,40 @@ const fetchSurveyByProfileId = async profileId => {
43 43
 
44 44
 // TODO: separate to newSurvey vs updateSurvey
45 45
 const saveSurveyByProfileID = async (surveyResponses, profileId) => {
46
-    surveyResponses.forEach((responseKeyIdwithVal) => {
46
+    surveyResponses.forEach(responseKeyIdwithVal => {
47 47
         const keyId = responseKeyIdwithVal.response_key_id
48 48
         const val = responseKeyIdwithVal.val
49
-        // POST 
50
-        const myresponses = db.post(`/${profileId}/respond?response_key_id=${keyId}&val=${val}`)
51
-        return myresponses
49
+        console.log('saveSurvey keyId', keyId)
50
+        console.log('saveSurvey val', val)
51
+        
52
+        // POST
53
+        // const myresponses = db.post(`/${profileId}/respond?response_key_id=${keyId}&val=${val}`)
54
+        // return myresponses
52 55
     })
53 56
 }
54 57
 
55 58
 const updateSurveyByProfileId = async (surveyResponses, profileId) => {
56
-    surveyResponses.forEach((responseKeyIdwithVal) => {
59
+    surveyResponses.forEach(responseKeyIdwithVal => {
57 60
         const keyId = responseKeyIdwithVal.response_key_id
58 61
         const val = responseKeyIdwithVal.val
59
-    // PATCH
60
-    // const myresponses = db.patch(`/profile/${profileId}/update/${keyId}`,
61
-    // [
62
-    //     {
63
-    //         response_id: 2,
64
-    //         profile_id: profileId,
65
-    //         response_key_id: keyId,
66
-    //         val: val,
67
-    //     },
68
-    // ]
69
-    // )
62
+        console.log('saveSurvey keyId', keyId)
63
+        console.log('saveSurvey val', val)
64
+        // PATCH
65
+        // const myresponses = db.patch(`/profile/${profileId}/update/${keyId}`,
66
+        //     [
67
+        //         {
68
+        //             response_id: 2,
69
+        //             profile_id: profileId,
70
+        //             response_key_id: keyId,
71
+        //             val: val,
72
+        //         },
73
+        //     ]
74
+        // )
75
+    })
70 76
 }
71 77
 
72 78
 export {
73 79
     fetchSurveyByProfileId,
74 80
     saveSurveyByProfileID,
75 81
     updateSurveyByProfileId,
76
- }
82
+}

+ 2
- 2
frontend/src/views/home.vue Zobrazit soubor

@@ -29,8 +29,8 @@ export default {
29 29
         // this.mypid = auth.currentUser?.mypid || "99999";
30 30
         this.mypid = 21
31 31
         this.processProfiles()
32
-        this.queueList = fetchQueueByProfileId(mypid)
33
-        console.log('queueList', queueList)
32
+        // this.queueList = fetchQueueByProfileId(mypid)
33
+        // console.log('queueList', queueList)
34 34
     },
35 35
     methods: {
36 36
         parseBatch(allBatches) {

Načítá se…
Zrušit
Uložit