@ -75,6 +75,7 @@ import useValidate from '@vuelidate/core'
import CscPageSticky from 'components/CscPageSticky'
import CscPageSticky from 'components/CscPageSticky'
import { mapWaitingActions } from 'vue-wait'
import { mapWaitingActions } from 'vue-wait'
import { required } from 'vuelidate/lib/validators'
import { required } from 'vuelidate/lib/validators'
import { mapGetters } from 'vuex'
export default {
export default {
name : 'CscPageSubscriberPhonebookAdd' ,
name : 'CscPageSubscriberPhonebookAdd' ,
components : {
components : {
@ -99,6 +100,9 @@ export default {
}
}
} ,
} ,
computed : {
computed : {
... mapGetters ( 'user' , [
'prefilledNumber'
] ) ,
nameErrorMessage ( ) {
nameErrorMessage ( ) {
const errorsTab = this . v$ . formData . name . $errors
const errorsTab = this . v$ . formData . name . $errors
if ( errorsTab && errorsTab . length > 0 && errorsTab [ 0 ] . $validator === 'required' ) {
if ( errorsTab && errorsTab . length > 0 && errorsTab [ 0 ] . $validator === 'required' ) {
@ -109,6 +113,12 @@ export default {
return ''
return ''
}
}
} ,
} ,
mounted ( ) {
if ( this . prefilledNumber ) {
this . formData . number = this . prefilledNumber
this . $store . commit ( 'user/setPhonebookNumber' , '' )
}
} ,
methods : {
methods : {
... mapWaitingActions ( 'user' , {
... mapWaitingActions ( 'user' , {
createPhonebookSubscriber : 'createPhonebookSubscriber'
createPhonebookSubscriber : 'createPhonebookSubscriber'