small changes
This commit is contained in:
@@ -13,13 +13,14 @@ export const actions: Actions = {
|
||||
const data = await request.formData();
|
||||
const name = String(data.get('name') ?? '').trim();
|
||||
const dog = String(data.get('dog') ?? '').trim();
|
||||
const phone = String(data.get('phone') ?? '').trim();
|
||||
const message = String(data.get('message') ?? '').trim();
|
||||
|
||||
if (!name || !message) {
|
||||
return fail(400, { error: 'Compila almeno nome e messaggio.', name, dog, message });
|
||||
if (!name || !phone || !message) {
|
||||
return fail(400, { error: 'Compila nome, telefono e messaggio.', name, dog, phone, message });
|
||||
}
|
||||
|
||||
const entry = addSubmission({ name, dog, message, ip: getClientAddress() });
|
||||
const entry = addSubmission({ name, dog, phone, message, ip: getClientAddress() });
|
||||
addNotification({
|
||||
type: 'submission',
|
||||
title: 'Nuova richiesta dal form',
|
||||
|
||||
Reference in New Issue
Block a user