Add events
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2024-10-03 19:47:28 +02:00
parent b2968c8cfc
commit 20d53177d4
1 changed files with 5 additions and 0 deletions

View File

@ -76,6 +76,8 @@ Alpine.data('form', () => ({
}
);
_paq.push(['trackEvent', 'anfrage', 'dateValidated', 'result', response.data.result]);
tippy('[data-tippy-target]', {
content: response.data.result ? 'Dieser Termin ist voraussichtlich verfügbar' : 'Dieser Termin ist leider nicht buchbar',
showOnCreate: true,
@ -105,12 +107,15 @@ Alpine.data('form', () => ({
behaviour: 'smooth',
});
this.sending = false;
_paq.push(['trackEvent', 'anfrage', 'submitted']);
} catch (e) {
this.sending = false;
if (!e instanceof axios.AxiosError || !e.response || !e.response.data || !e.response.data['X_WINTER_ERROR_FIELDS']) {
_paq.push(['trackEvent', 'anfrage', 'submitInternalError']);
throw e;
}
const errors = e.response.data['X_WINTER_ERROR_FIELDS'];
_paq.push(['trackEvent', 'anfrage', 'submitValidationFailed']);
Object.keys(errors).forEach((k) => {
errors[k].forEach((msg) => error(msg));
});