Clean up code
This commit is contained in:
parent
b498dc4efa
commit
e296d500aa
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
data() {
|
||||
return {
|
||||
// survey
|
||||
survey: this.initSurvey(),
|
||||
title: ''
|
||||
}
|
||||
|
|
@ -35,7 +34,6 @@
|
|||
survey.data = answer;
|
||||
|
||||
survey.onComplete.add((sender, options) => {
|
||||
console.log(survey.data);
|
||||
sender.clear(false);
|
||||
|
||||
sender.mode = 'display';
|
||||
|
|
@ -70,14 +68,12 @@
|
|||
manual: true,
|
||||
result({data, loading, networkStatus}) {
|
||||
if (!loading) {
|
||||
console.log(data);
|
||||
let json = JSON.parse(data.survey.data);
|
||||
let answer = {};
|
||||
if (data.survey.answer && data.survey.answer.data) {
|
||||
answer = JSON.parse(data.survey.answer.data);
|
||||
}
|
||||
|
||||
console.log(json);
|
||||
this.survey = this.initSurvey(json, answer);
|
||||
this.title = data.survey.title;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@ def get_graphql_mutation(filename):
|
|||
|
||||
def get_by_id(model, **kwargs):
|
||||
id = kwargs.get('id')
|
||||
if id is not None:
|
||||
return get_object(model, id)
|
||||
return None
|
||||
|
||||
return get_object(model, id) if id is not None else None
|
||||
|
||||
|
||||
def get_by_id_or_slug(model, **kwargs):
|
||||
slug = kwargs.get('slug')
|
||||
|
|
|
|||
Loading…
Reference in New Issue