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