Skip to content

Commit

Permalink
#156 fixed if no success page is configured
Browse files Browse the repository at this point in the history
  • Loading branch information
smcgrath0 committed Sep 8, 2020
1 parent 733a4a3 commit c4438fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion fragments/form/template.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
export default {
props: ['model'],
data() {
console.log('success successpage1', this.model.successpage);
return {
formModel: {},
formOptions: {
Expand Down Expand Up @@ -70,7 +71,11 @@ export default {
form: this.formModel
})
.then( (response) => {
$peregrineApp.loadContent(this.model.successpage)
if (this.model.successpage) {
$peregrineApp.loadContent(this.model.successpage)
} else {
window.dispatchEvent(new CustomEvent('form-clear',{}));
}
})
.catch( (error) => {
Vue.set(this, 'failureText', this.model.failmessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export default {
form: this.formModel
})
.then( (response) => {
$peregrineApp.loadContent(this.model.successpage)
if (this.model.successpage) {
$peregrineApp.loadContent(this.model.successpage)
} else {
window.dispatchEvent(new CustomEvent('form-clear',{}));
}
})
.catch( (error) => {
Vue.set(this, 'failureText', this.model.failmessage);
Expand Down

0 comments on commit c4438fd

Please sign in to comment.