Преглед изворни кода

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

tags/0.0.1
diaseu пре 4 година
родитељ
комит
e7c9d0d347

+ 1
- 0
frontend/src/services/index.js Прегледај датотеку

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

+ 2
- 2
frontend/src/services/queue.service.js Прегледај датотеку

8
     const profilelist = []
8
     const profilelist = []
9
 
9
 
10
     // WIP
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
 const saveQueueByProfileId = async (targetId, profileId) => {
15
 const saveQueueByProfileId = async (targetId, profileId) => {

+ 25
- 19
frontend/src/services/survey.service.js Прегледај датотеку

10
  */
10
  */
11
 const fetchSurveyByProfileId = async profileId => {
11
 const fetchSurveyByProfileId = async profileId => {
12
     const myquestions = await db.get(`/survey/questions`)
12
     const myquestions = await db.get(`/survey/questions`)
13
-    const allsteps = { }
13
+    const allsteps = {}
14
     const questionsPerStep = 3
14
     const questionsPerStep = 3
15
     const stepsNeeded = Math.ceil(myquestions.length / questionsPerStep)
15
     const stepsNeeded = Math.ceil(myquestions.length / questionsPerStep)
16
 
16
 
32
             category: question.response_key_category,
32
             category: question.response_key_category,
33
         }
33
         }
34
         for (let n = 1; n <= stepsNeeded; n++) {
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
                 allsteps[`step-${n}`].push(reformatted)
36
                 allsteps[`step-${n}`].push(reformatted)
37
             }
37
             }
38
         }
38
         }
43
 
43
 
44
 // TODO: separate to newSurvey vs updateSurvey
44
 // TODO: separate to newSurvey vs updateSurvey
45
 const saveSurveyByProfileID = async (surveyResponses, profileId) => {
45
 const saveSurveyByProfileID = async (surveyResponses, profileId) => {
46
-    surveyResponses.forEach((responseKeyIdwithVal) => {
46
+    surveyResponses.forEach(responseKeyIdwithVal => {
47
         const keyId = responseKeyIdwithVal.response_key_id
47
         const keyId = responseKeyIdwithVal.response_key_id
48
         const val = responseKeyIdwithVal.val
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
 const updateSurveyByProfileId = async (surveyResponses, profileId) => {
58
 const updateSurveyByProfileId = async (surveyResponses, profileId) => {
56
-    surveyResponses.forEach((responseKeyIdwithVal) => {
59
+    surveyResponses.forEach(responseKeyIdwithVal => {
57
         const keyId = responseKeyIdwithVal.response_key_id
60
         const keyId = responseKeyIdwithVal.response_key_id
58
         const val = responseKeyIdwithVal.val
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
 export {
78
 export {
73
     fetchSurveyByProfileId,
79
     fetchSurveyByProfileId,
74
     saveSurveyByProfileID,
80
     saveSurveyByProfileID,
75
     updateSurveyByProfileId,
81
     updateSurveyByProfileId,
76
- }
82
+}

+ 2
- 2
frontend/src/views/home.vue Прегледај датотеку

29
         // this.mypid = auth.currentUser?.mypid || "99999";
29
         // this.mypid = auth.currentUser?.mypid || "99999";
30
         this.mypid = 21
30
         this.mypid = 21
31
         this.processProfiles()
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
     methods: {
35
     methods: {
36
         parseBatch(allBatches) {
36
         parseBatch(allBatches) {

Loading…
Откажи
Сачувај