Browse Source

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

tags/0.0.1
diaseu 4 years ago
parent
commit
d3ed2bbb7a
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      frontend/src/services/survey.service.js

+ 5
- 3
frontend/src/services/survey.service.js View File

@@ -46,14 +46,16 @@ const saveSurveyByProfileID = async (surveyResponses, profileId) => {
46 46
     surveyResponses.forEach((responseKeyIdwithVal) => {
47 47
         const keyId = responseKeyIdwithVal.response_key_id
48 48
         const val = responseKeyIdwithVal.val
49
-        console.log('posting this', `/${profileId}/respond?response_key_id=${keyId}&val=${val}`)
50 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 55
 const updateSurveyByProfileId = async (surveyResponses, profileId) => {
56
+    surveyResponses.forEach((responseKeyIdwithVal) => {
57
+        const keyId = responseKeyIdwithVal.response_key_id
58
+        const val = responseKeyIdwithVal.val
57 59
     // PATCH
58 60
     // const myresponses = db.patch(`/profile/${profileId}/update/${keyId}`,
59 61
     // [

Loading…
Cancel
Save