Skip to content

Commit

Permalink
Removing telegram field validation
Browse files Browse the repository at this point in the history
  • Loading branch information
maayarosama committed Mar 27, 2024
1 parent 02e80b4 commit 1e5488e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
4 changes: 1 addition & 3 deletions client/src/components/AddUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</v-col>
<v-col cols="6">
<v-text-field v-model="telegram_link" label="Telegram" density="comfortable"
:rules="telegramRules"></v-text-field>
:rules="requiredRules"></v-text-field>

<v-text-field v-model="birthday" label="Birthday" density="comfortable" :rules="requiredStringRules"
@click="toggleDatePicker('birthdayPicker')" readonly>
Expand Down Expand Up @@ -83,7 +83,6 @@ import {
mobileRules,
jobRules,
addressRules,
telegramRules,
requiredStringRules,
requiredRules
} from '@/utils'
Expand Down Expand Up @@ -252,7 +251,6 @@ export default {
mobileRules,
jobRules,
addressRules,
telegramRules,
requiredStringRules,
requiredRules,
isLoading,
Expand Down
4 changes: 1 addition & 3 deletions client/src/components/UpdateUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</v-col>
<v-col cols="6" v-if="selectedUser">
<v-text-field v-model="selectedUser.telegram_link" label="Telegram" density="comfortable"
:rules="telegramRules"></v-text-field>
:rules="requiredRules"></v-text-field>

<v-text-field v-model="selectedUser.birthday" label="Birthday" density="comfortable"
:rules="requiredStringRules" @click="toggleDatePicker('birthdayPicker')" readonly>
Expand Down Expand Up @@ -110,7 +110,6 @@ import {
mobileRules,
jobRules,
addressRules,
telegramRules,
requiredStringRules,
requiredRules,
formatDate,
Expand Down Expand Up @@ -281,7 +280,6 @@ export default {
addressRules,
supervisorPage,
supervisorCount,
telegramRules,
requiredStringRules,
requiredRules,
isLoading,
Expand Down
14 changes: 7 additions & 7 deletions client/src/utils/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ export const addressRules = [
// (v: string) =>
// (v && v.length >= 3 && v.length <= 50) || 'Social Number must be between 3 and 50 characters.'
// ]
export const telegramRules = [
(v: string) => typeof v === 'string' || 'Telegram must be a string.',
(v: string) => !!v || 'Telegram is required.',
(v: string) => /^@([A-Za-z0-9_]{1,255})$/.test(v) || 'Telegram handle is not valid.',
(v: string) =>
(v && v.length >= 3 && v.length <= 50) || 'Telegram must be between 3 and 50 characters.'
]
// export const telegramRules = [
// (v: string) => typeof v === 'string' || 'Telegram must be a string.',
// (v: string) => !!v || 'Telegram is required.',
// (v: string) => /^@([A-Za-z0-9_]{1,255})$/.test(v) || 'Telegram handle is not valid.',
// (v: string) =>
// (v && v.length >= 3 && v.length <= 50) || 'Telegram must be between 3 and 50 characters.'
// ]
export const requiredStringRules = [
(v: string) => typeof v === 'string' || 'This field must be a string.',
(v: string) => !!v || 'This field is required.'
Expand Down

0 comments on commit 1e5488e

Please sign in to comment.