This commit is contained in:
@@ -134,6 +134,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
json(response) {
|
json(response) {
|
||||||
|
if (response.status == 204) {
|
||||||
|
//no content, nothing to process
|
||||||
|
return response;
|
||||||
|
}
|
||||||
return response.json();
|
return response.json();
|
||||||
},
|
},
|
||||||
apiErrorToHumanString(apiError) {
|
apiErrorToHumanString(apiError) {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
>{{ formState.errorBoxMessage }}</v-alert
|
>{{ formState.errorBoxMessage }}</v-alert
|
||||||
>
|
>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
<!-- {{ formState }} -->
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="obj.loginName"
|
v-model="obj.loginName"
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
const FORM_KEY = "home-password";
|
const FORM_KEY = "home-password";
|
||||||
const API_BASE_URL = "Auth/";
|
const API_BASE_URL = "Auth/ChangePassword";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
created() {
|
created() {
|
||||||
@@ -101,6 +101,13 @@ export default {
|
|||||||
vm.rights = window.$gz.role.fullRightsObject();
|
vm.rights = window.$gz.role.fullRightsObject();
|
||||||
generateMenu(vm);
|
generateMenu(vm);
|
||||||
vm.formState.ready = true;
|
vm.formState.ready = true;
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: vm,
|
||||||
|
dirty: false,
|
||||||
|
valid: true,
|
||||||
|
loading: false,
|
||||||
|
readOnly: false
|
||||||
|
});
|
||||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
@@ -133,7 +140,7 @@ export default {
|
|||||||
newPassword: null,
|
newPassword: null,
|
||||||
confirmPassword: null
|
confirmPassword: null
|
||||||
},
|
},
|
||||||
reveal: false,
|
reveal: true,
|
||||||
formState: {
|
formState: {
|
||||||
ready: false,
|
ready: false,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
@@ -187,61 +194,14 @@ export default {
|
|||||||
window.$gz.form.onChange(this, ref);
|
window.$gz.form.onChange(this, ref);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// getDataFromApi() {
|
|
||||||
// var vm = this;
|
|
||||||
// vm.formState.loading = true;
|
|
||||||
// //always fetch on this form for the current logged in user id
|
|
||||||
// var url = API_BASE_URL + vm.$store.state.userId;
|
|
||||||
|
|
||||||
// window.$gz.form.deleteAllErrorBoxErrors(vm);
|
|
||||||
|
|
||||||
// window.$gz.api
|
|
||||||
// .get(url)
|
|
||||||
// .then(res => {
|
|
||||||
// if (res.error != undefined) {
|
|
||||||
// //Not found?
|
|
||||||
// if (res.error.code == "2010") {
|
|
||||||
// //notify not found error then navigate backwards
|
|
||||||
// window.$gz.dialog
|
|
||||||
// .displayLTErrorMessage("ErrorAPI2010")
|
|
||||||
// .then(() => {
|
|
||||||
// // navigate backwards
|
|
||||||
// vm.$router.go(-1);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// vm.formState.serverError = res.error;
|
|
||||||
// window.$gz.form.setErrorBoxErrors(vm);
|
|
||||||
// } else {
|
|
||||||
// vm.obj = res.data;
|
|
||||||
|
|
||||||
// //Update the form status
|
|
||||||
// window.$gz.form.setFormState({
|
|
||||||
// vm: vm,
|
|
||||||
// dirty: false,
|
|
||||||
// valid: true,
|
|
||||||
// loading: false,
|
|
||||||
// readOnly: res.readOnly ? true : false
|
|
||||||
// });
|
|
||||||
// //modify the menu as necessary
|
|
||||||
// generateMenu(vm);
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .catch(function handleGetDataFromAPIError(error) {
|
|
||||||
// //Update the form status
|
|
||||||
// window.$gz.form.setFormState({
|
|
||||||
// vm: vm,
|
|
||||||
// loading: false
|
|
||||||
// });
|
|
||||||
// window.$gz.errorHandler.handleFormError(error, vm);
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
submit() {
|
submit() {
|
||||||
var vm = this;
|
var vm = this;
|
||||||
if (vm.canSave) {
|
if (vm.canSave) {
|
||||||
vm.formState.loading = true;
|
vm.formState.loading = true;
|
||||||
|
|
||||||
//always submit from this form for the current logged in user id
|
//always submit from this form for the current logged in user id
|
||||||
var url = API_BASE_URL + vm.$store.state.userId;
|
var url = API_BASE_URL;
|
||||||
|
|
||||||
//clear any errors vm might be around from previous submit
|
//clear any errors vm might be around from previous submit
|
||||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||||
@@ -253,10 +213,7 @@ export default {
|
|||||||
vm.formState.serverError = res.error;
|
vm.formState.serverError = res.error;
|
||||||
window.$gz.form.setErrorBoxErrors(vm);
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
} else {
|
} else {
|
||||||
//UserOptions is never a POST as it always exists and can't be deleted so always a PUT
|
//Only a post, no data returned
|
||||||
|
|
||||||
//Handle "put" of an existing record (UPDATE)
|
|
||||||
vm.obj.concurrencyToken = res.data.concurrencyToken;
|
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: vm,
|
vm: vm,
|
||||||
dirty: false
|
dirty: false
|
||||||
|
|||||||
Reference in New Issue
Block a user