This commit is contained in:
@@ -240,6 +240,7 @@ Localized input and parsing and validation
|
|||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
TODO AFTER CLIENT block ABOVE:
|
TODO AFTER CLIENT block ABOVE:
|
||||||
|
ON UPDATE: have an url that opens automatically or a notification and link to one after a new version has been detected just like visual studio does in order to show what is new in this version
|
||||||
|
|
||||||
ABOUT form - add the user settings such as timezone offset, locale formatting patterns etc, will be useful for troubleshooting
|
ABOUT form - add the user settings such as timezone offset, locale formatting patterns etc, will be useful for troubleshooting
|
||||||
|
|
||||||
|
|||||||
@@ -178,8 +178,8 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
Change(ref) {
|
Change(ref) {
|
||||||
this.$gzv.Change(this, ref);
|
this.$gzv.Change(this, ref);
|
||||||
},
|
},
|
||||||
getDataFromApi() {
|
getDataFromApi() {
|
||||||
var url = "Widget/" + this.$route.params.id;
|
var url = "Widget/" + this.$route.params.id;
|
||||||
@@ -188,21 +188,17 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
// debugger;
|
//check if form is valid, as far as I know this is the way you're supposed to do it and in testing it does not force all fields to revalidate individually
|
||||||
|
if (this.$refs.form.validate()) {
|
||||||
|
var that = this;
|
||||||
|
var url = "Widget/" + this.$route.params.id;
|
||||||
|
|
||||||
//TODO: CHECK FOR BROKEN RULES AND DON'T SUBMIT IF THERE ARE ANY HERE
|
//clear any errors that might be around from previous submit
|
||||||
|
this.$gzutil.RemoveAllPropertiesFromObject(this.serverError);
|
||||||
|
|
||||||
var that = this;
|
this.$gzapi.upsert(url, this.obj).then(res => {
|
||||||
var url = "Widget/" + this.$route.params.id;
|
if (res.error) {
|
||||||
|
that.serverError = res.error;
|
||||||
//clear any errors that might be around from previous submit
|
|
||||||
this.$gzutil.RemoveAllPropertiesFromObject(this.serverError);
|
|
||||||
|
|
||||||
this.$gzapi
|
|
||||||
.upsert(url, this.obj)
|
|
||||||
.then(res => {
|
|
||||||
if (res.error) {
|
|
||||||
that.serverError = res.error;
|
|
||||||
} else {
|
} else {
|
||||||
//Logic for detecting if a post or put: if id then it was a post, if no id then it was a put
|
//Logic for detecting if a post or put: if id then it was a post, if no id then it was a put
|
||||||
if (res.id) {
|
if (res.id) {
|
||||||
@@ -214,10 +210,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//In theory all exceptions should be handled by the gzapi methods, so we should not need to deal with this in the form very often if at all
|
//In theory all exceptions should be handled by the gzapi methods, so we should not need to deal with this in the form very often if at all
|
||||||
// .catch(function(error) {
|
// .catch(function(error) {
|
||||||
// });
|
// });
|
||||||
|
} else {
|
||||||
|
}
|
||||||
} //end of submit()
|
} //end of submit()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user