Commit 47ad95cd authored by yangchenglin's avatar yangchenglin

answers_add

parent 70bb8755
......@@ -31,10 +31,19 @@ class SurveyView(APIView):
"template_id": int(request.POST.get('template_id', 0)),
}
self.rpc['venus/sun/survey/add'](data=data).unwrap()
data = self.rpc['venus/sun/survey/add'](data=data).unwrap()
return data
class SurveyAddAnswerView(APIView):
def post(self, request):
answers = json.loads(request.POST.get('answers'))
self.rpc['venus/sun/survey/answers_add'](data=answers).unwrap()
return {
"status": 1
}
......@@ -252,6 +252,7 @@ urlpatterns = [
url(r'^survey_question/create$', SurveyView.as_view()),
url(r'^survey_question/get$', SurveyView.as_view()),
url(r'^survey_question/list$', SurveyListView.as_view()),
url(r'^survey_question/add_answer$', SurveyAddAnswerView.as_view()),
]
search_urlpatterns = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment