Skip to content

Commit 286ab95

Browse files
adding telegram validation
1 parent 209dd2c commit 286ab95

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/pages/nuevo-empleo.astro

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,19 @@ for (const key in categories) {
191191
!data.applyPhone
192192
) {
193193
showToast(
194-
"Debe proporcionar al menos un método de contacto.",
194+
"Debe proporcionar al menos un método de contacto (Correo Electrónico, URL, Usuario de Telegram o Número Telefónico).",
195+
true
196+
);
197+
return;
198+
}
199+
200+
const telegramUser = data.applyTelegramUser;
201+
const isUrl = telegramUser.startsWith("http://") || telegramUser.startsWith("https://");
202+
const startsWithAt = telegramUser.startsWith("@");
203+
204+
if (telegramUser && (isUrl || startsWithAt)) {
205+
showToast(
206+
"El campo 'Usuario de Telegram' no debe ser una URL ni empezar con '@'. Por favor, introduzca solo el nombre de usuario.",
195207
true
196208
);
197209
return;

0 commit comments

Comments
 (0)