Skip to content

Commit

Permalink
Using common utils
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-barraza committed Sep 23, 2024
1 parent 8401143 commit b0aba67
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions auth-web/src/components/pay/eft/ShortNameFinancialDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
</template>
<script lang="ts">
import { Ref, computed, defineComponent, reactive, ref, toRefs, watch } from '@vue/composition-api'
import CommonUtils from '@/util/common-util'
import { EFTShortnameResponse } from '@/models/eft-transaction'
import ModalDialog from '@/components/auth/common/ModalDialog.vue'
import PaymentService from '@/services/payment.services'
Expand All @@ -83,6 +84,7 @@ export default defineComponent({
},
emits: ['on-patch', 'close-short-name-email-dialog'],
setup (props, { emit }) {
const emailAddressRules = CommonUtils.emailRules()
const modalDialog: Ref<InstanceType<typeof ModalDialog>> = ref(null)
const accountLinkingErrorDialog: Ref<InstanceType<typeof ModalDialog>> = ref(null)
const state = reactive<any>({
Expand All @@ -92,14 +94,6 @@ export default defineComponent({
isDialogTypeCasSupplierNumber: computed(() => props.shortNameFinancialDialogType === 'CAS_SUPPLIER_NUMBER')
})
const emailAddressRules = [
v => !!v || 'Email address is required',
v => {
const pattern = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
return pattern.test(v) || 'Valid email is required'
}
]
function isFormValid () {
if (state.isDialogTypeEmail) {
return emailAddressRules.every(rule => rule(state.email) !== true)
Expand Down

0 comments on commit b0aba67

Please sign in to comment.