show invalid fields an messages on action error popup input error
All checks were successful
deploy / build-and-deploy (push) Successful in 18s
All checks were successful
deploy / build-and-deploy (push) Successful in 18s
This commit is contained in:
@ -30,6 +30,7 @@ import Input from '@components/input/Input.svelte';
|
||||
import { actions } from 'astro:actions';
|
||||
import { confirmPopupState } from '@components/popup/ConfirmPopup';
|
||||
import { popupState } from '@components/popup/Popup';
|
||||
import { actionErrorPopup } from '../util/action';
|
||||
|
||||
const form = document.getElementById('feedback-contact') as HTMLFormElement;
|
||||
const type = document.getElementById('type') as HTMLSelectElement;
|
||||
@ -74,17 +75,12 @@ import Input from '@components/input/Input.svelte';
|
||||
|
||||
async function sendFeedback() {
|
||||
const { error } = await actions.feedback.addWebsiteFeedback({
|
||||
type: 'website-feedback',
|
||||
content: content.value
|
||||
});
|
||||
|
||||
if (error) {
|
||||
popupState.set({
|
||||
type: 'error',
|
||||
title: 'Fehler beim senden des Feedbacks',
|
||||
message: error.message
|
||||
});
|
||||
throw error;
|
||||
actionErrorPopup(error);
|
||||
return;
|
||||
}
|
||||
|
||||
popupState.set({
|
||||
@ -96,18 +92,13 @@ import Input from '@components/input/Input.svelte';
|
||||
|
||||
async function sendContact() {
|
||||
const { error } = await actions.feedback.addWebsiteContact({
|
||||
type: 'website-contact',
|
||||
content: content.value,
|
||||
email: email.value
|
||||
});
|
||||
|
||||
if (error) {
|
||||
popupState.set({
|
||||
type: 'error',
|
||||
title: 'Fehler beim senden der Kontaktanfrage',
|
||||
message: error.message
|
||||
});
|
||||
throw error;
|
||||
actionErrorPopup(error);
|
||||
return;
|
||||
}
|
||||
|
||||
popupState.set({
|
||||
|
Reference in New Issue
Block a user