|
|
@@ -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
|
// [
|