소스 검색

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,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…
취소
저장