Commit b3274560 authored by Mycha de Vrees's avatar Mycha de Vrees
Browse files

profile form validations

parent 2d6d1bcd
Pipeline #342 passed with stage
in 1 minute and 26 seconds
......@@ -43,7 +43,7 @@
</div>
<div class="md-layout-item md-size-100 text-right">
<md-button class="md-primary" @click="showPasswordForm = !showPasswordForm">Reset password?</md-button>
<md-button class="md-raised md-success" @click="userUpdate">Update Profile</md-button>
<md-button class="md-raised md-success" @click="userUpdate" :disabled="$v.form.$invalid">Update Profile</md-button>
</div>
<div class="md-layout-item md-size-50" v-show="showPasswordForm">
<md-field>
......@@ -64,6 +64,7 @@
<script>
import _ from 'lodash'
import { mapGetters, mapActions } from 'vuex'
import { required, email } from 'vuelidate/lib/validators'
export default {
name: 'edit-profile-form',
......@@ -73,6 +74,16 @@ export default {
default: ''
}
},
validations: {
form: {
email: {
required, email
},
name: {
required
}
}
},
data () {
return {
form: null,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment