This commit is contained in:
2020-03-05 20:05:05 +00:00
parent 59e6b971e2
commit 9deb0d066c
2 changed files with 16 additions and 55 deletions

View File

@@ -134,6 +134,10 @@ export default {
}
},
json(response) {
if (response.status == 204) {
//no content, nothing to process
return response;
}
return response.json();
},
apiErrorToHumanString(apiError) {

View File

@@ -16,7 +16,7 @@
>{{ formState.errorBoxMessage }}</v-alert
>
</v-col>
<!-- {{ formState }} -->
<v-col cols="12">
<v-text-field
v-model="obj.loginName"
@@ -91,7 +91,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////
const FORM_KEY = "home-password";
const API_BASE_URL = "Auth/";
const API_BASE_URL = "Auth/ChangePassword";
export default {
created() {
@@ -101,6 +101,13 @@ export default {
vm.rights = window.$gz.role.fullRightsObject();
generateMenu(vm);
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);
})
.catch(err => {
@@ -133,7 +140,7 @@ export default {
newPassword: null,
confirmPassword: null
},
reveal: false,
reveal: true,
formState: {
ready: false,
dirty: false,
@@ -187,61 +194,14 @@ export default {
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() {
var vm = this;
if (vm.canSave) {
vm.formState.loading = true;
//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
window.$gz.form.deleteAllErrorBoxErrors(vm);
@@ -253,10 +213,7 @@ export default {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
} else {
//UserOptions is never a POST as it always exists and can't be deleted so always a PUT
//Handle "put" of an existing record (UPDATE)
vm.obj.concurrencyToken = res.data.concurrencyToken;
//Only a post, no data returned
window.$gz.form.setFormState({
vm: vm,
dirty: false