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

pull questions from db, post survey response, need to score next

tags/0.0.1
diaseu пре 4 година
родитељ
комит
d3ed2bbb7a
1 измењених фајлова са 5 додато и 3 уклоњено
  1. 5
    3
      frontend/src/services/survey.service.js

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

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
-        console.log('posting this', `/${profileId}/respond?response_key_id=${keyId}&val=${val}`)
50
         // POST 
49
         // POST 
51
-        // const myresponses = db.post(`/${profileId}/respond?response_key_id=${keyId}&val=${val}`)
52
-        // return myresponses
50
+        const myresponses = db.post(`/${profileId}/respond?response_key_id=${keyId}&val=${val}`)
51
+        return myresponses
53
     })
52
     })
54
 }
53
 }
55
 
54
 
56
 const updateSurveyByProfileId = async (surveyResponses, profileId) => {
55
 const updateSurveyByProfileId = async (surveyResponses, profileId) => {
56
+    surveyResponses.forEach((responseKeyIdwithVal) => {
57
+        const keyId = responseKeyIdwithVal.response_key_id
58
+        const val = responseKeyIdwithVal.val
57
     // PATCH
59
     // PATCH
58
     // const myresponses = db.patch(`/profile/${profileId}/update/${keyId}`,
60
     // const myresponses = db.patch(`/profile/${profileId}/update/${keyId}`,
59
     // [
61
     // [

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