From 4a5a4f990c59f78bb9be5919b102907c767d2dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veronika=20Feh=C3=A9rv=C3=ADziov=C3=A1?= <128744051+VeronikaFeherviziova@users.noreply.github.com> Date: Tue, 2 Dec 2025 20:28:17 +0100 Subject: [PATCH] feat: improve phone input validation and update study program options in registration form --- frontend/app/pages/register/student.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/app/pages/register/student.vue b/frontend/app/pages/register/student.vue index 29b530e..2ff381a 100644 --- a/frontend/app/pages/register/student.vue +++ b/frontend/app/pages/register/student.vue @@ -23,11 +23,14 @@ const rules = { personal_email: (v: string) => /.+@.+\..+/.test(v) || 'Zadajte platný osobný email', phone: (v: string) => - (!v || /^[0-9 +()-]{6,}$/.test(v)) || 'Zadajte platné telefónne číslo', + (!v || /^\+[0-9]{6,13}$/.test(v)) || 'Zadajte platné telefónne číslo. Príklad: +421908123456', mustAgree: (v: boolean) => v === true || 'Je potrebné súhlasiť', }; const programs = [ - 'Aplikovaná informatika', + { title: 'Aplikovaná informatika, Bc. (AI22b)', value: 'AI22b' }, + { title: 'Aplikovaná informatika, Bc. (AI15b)', value: 'AI15b' }, + { title: 'Aplikovaná informatika, Mgr. (AI22m)', value: 'AI22m' }, + { title: 'Aplikovaná informatika, Mgr. (AI15m)', value: 'AI15m' }, ]; const isValid = ref(false); @@ -38,7 +41,7 @@ const form = ref({ studentEmail: '', personalEmail: '', phone: '', - studyProgram: programs[0] as string, + studyProgram: programs[0]!.value, year_of_study: 1, consent: false, }); @@ -109,8 +112,8 @@ async function handleRegistration() { - +