Filling questionnaire process for client now works like a charm

This commit is contained in:
2018-01-16 15:18:22 +07:00
parent 573f678c69
commit 3f66ec9a4c
10 changed files with 1810 additions and 1429 deletions

View File

@@ -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);
})
}
}

View File

@@ -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
})
},