Skip to content

Commit

Permalink
Merge pull request #822 from HiP-App/iss-hipcms-quizBug
Browse files Browse the repository at this point in the history
fixed error while cancelling edit quiz dialog box
  • Loading branch information
melkishengue authored Sep 14, 2018
2 parents f9ec014 + 24eae25 commit 802ccb3
Show file tree
Hide file tree
Showing 2 changed files with 1,394 additions and 1,392 deletions.
18 changes: 10 additions & 8 deletions app/mobile-content/exhibits/quiz/quiz/quiz.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,16 @@ export class QuizComponent implements OnInit {
this.questionDialogRef = this.dialog.open(QuestionDialogComponent, { width: '450px', height: '720px', data: clonedQuestion });
this.questionDialogRef.afterClosed().subscribe(
(editedQuestion: Question) => {
this.quizService.updateQuestion(editedQuestion)
.then(() => {
this.toasterService.pop('success', this.translate('success editing question'));
this.getQuestions();
})
.catch(
error => this.toasterService.pop('error', this.translate('error editing question'), error)
);
if (editedQuestion) {
this.quizService.updateQuestion(editedQuestion)
.then(() => {
this.toasterService.pop('success', this.translate('success editing question'));
this.getQuestions();
})
.catch(
error => this.toasterService.pop('error', this.translate('error editing question'), error)
);
}
}
);
}
Expand Down
Loading

0 comments on commit 802ccb3

Please sign in to comment.