Filling questionnaire process for client now works like a charm
This commit is contained in:
5
assets/js/models/QuestionAnswer.js
vendored
5
assets/js/models/QuestionAnswer.js
vendored
@@ -11,12 +11,14 @@ const QuestionAnswer = {
|
||||
method: "GET"
|
||||
})
|
||||
.then(function(res) {
|
||||
res.data = res.data[0]
|
||||
QuestionAnswer.current = res
|
||||
QuestionAnswer.loading = false
|
||||
console.log("response: ", res);
|
||||
})
|
||||
},
|
||||
upload: function(questionId) {
|
||||
QuestionAnswer.loading = true
|
||||
questionId = questionId || QuestionAnswer.current.questionId
|
||||
m.request({
|
||||
url: "http://api.questionnaire.dev/v1/questions/" + questionId + "/answers",
|
||||
method: "POST",
|
||||
@@ -24,7 +26,6 @@ const QuestionAnswer = {
|
||||
})
|
||||
.then(function(res) {
|
||||
QuestionAnswer.loading = false
|
||||
console.log("response: ", res);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
5
assets/js/models/SectionQuestion.js
vendored
5
assets/js/models/SectionQuestion.js
vendored
@@ -4,15 +4,14 @@ const SectionQuestion = {
|
||||
current: {},
|
||||
list: [],
|
||||
loading: false,
|
||||
fetch: function(sectionId) {
|
||||
loadList: function(sectionId) {
|
||||
SectionQuestion.loading = true
|
||||
m.request({
|
||||
url: "http://api.questionnaire.dev/v1/sections/" + sectionId + "/questions",
|
||||
method: "GET"
|
||||
})
|
||||
.then(function(res) {
|
||||
res.data = res.data[0]
|
||||
SectionQuestion.current = res
|
||||
SectionQuestion.list = res
|
||||
SectionQuestion.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user