diff --git a/resources/assets/vue/components/settings/elements/UserProfileComponent.vue b/resources/assets/vue/components/settings/elements/UserProfileComponent.vue new file mode 100644 index 00000000..526c68a6 --- /dev/null +++ b/resources/assets/vue/components/settings/elements/UserProfileComponent.vue @@ -0,0 +1,60 @@ + + + diff --git a/resources/assets/vue/components/settings/forms/EditUserProfileFullnameFormComponent.vue b/resources/assets/vue/components/settings/forms/EditUserProfileFullnameFormComponent.vue new file mode 100644 index 00000000..73f5deab --- /dev/null +++ b/resources/assets/vue/components/settings/forms/EditUserProfileFullnameFormComponent.vue @@ -0,0 +1,50 @@ + + \ No newline at end of file diff --git a/resources/assets/vue/general/mixins/accounts/updateProfileHandler.js b/resources/assets/vue/general/mixins/accounts/updateProfileHandler.js new file mode 100644 index 00000000..4979dfd4 --- /dev/null +++ b/resources/assets/vue/general/mixins/accounts/updateProfileHandler.js @@ -0,0 +1,18 @@ +import errorMessageHandler from "../errorMessageHandler"; +import formHandler from "../formHandler"; + +export default { + methods: { + successHandler(response){ + this.closeModal(); + this.formHandler(''); + this.$store.dispatch('updateProfile', {fullname:response.payload.data.name}); + }, + errorHandler(error){ + console.log("error" ,error); + this.formHandler(error.message); + } + }, + mixins: [errorMessageHandler, formHandler] + +} \ No newline at end of file diff --git a/resources/assets/vue/general/mixins/accounts/validation/updateProfileFormValidation.js b/resources/assets/vue/general/mixins/accounts/validation/updateProfileFormValidation.js new file mode 100644 index 00000000..8be6ce0b --- /dev/null +++ b/resources/assets/vue/general/mixins/accounts/validation/updateProfileFormValidation.js @@ -0,0 +1,10 @@ +import { required } from "vuelidate/lib/validators"; +import updateProfileHandler from "../updateProfileHandler"; +export default { + validations: { + parameters: { + name: { required } + } + }, + mixins: [updateProfileHandler] +};