@@ -230,13 +234,15 @@
-
@@ -256,7 +262,6 @@ import 'dayjs/locale/de'
import 'flatpickr';
import {German} from 'flatpickr/dist/l10n/de';
import Vue from 'vue';
-import axios from 'axios';
export default {
name: 'GroupsPriceCalculator',
@@ -404,30 +409,31 @@ export default {
))
this.processing = true;
this.submitted = false;
- axios({
- url: this.endpoint,
- method: 'POST',
- data: formData,
- }).then(response => {
- if ('validation' === response.data.status) {
- this.formErrors = response.data.errors;
- } else {
- this.submitted = true;
- window.dataLayer = window.dataLayer || [];
- dataLayer.push({
- 'event': 'Preisberechnung'
- })
- }
- }).catch(error => {
- }).finally(() => {
- this.processing = false;
- });
+ fetch(this.endpoint, { method: 'POST', body: formData })
+ .then(response => response.json())
+ .then((json) => {
+ if ('validation' === json.status) {
+ this.formErrors = json.errors
+ } else {
+ this.submitted = true;
+ window.dataLayer = window.dataLayer || [];
+ dataLayer.push({
+ 'event': 'Preisberechnung'
+ })
+ }
+ })
+ .finally(() => {
+ this.processing = false
+ })
}
},
computed: {
nightsCount() {
return this.selectedRange.length;
},
+ forceInquiry() {
+ return 1 === this.selectedRange.length
+ },
rangeFormatted() {
if (null === this.selectedFrom || null === this.selectedTo) {
return '-';