This commit is contained in:
@@ -946,25 +946,19 @@ export default {
|
|||||||
vm.formState.serverError = res.error;
|
vm.formState.serverError = res.error;
|
||||||
window.$gz.form.setErrorBoxErrors(vm);
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
} 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
|
//POST or PUT - whole new object returned
|
||||||
if (res.data.id) {
|
vm.obj = res.data;
|
||||||
//POST - whole new object returned
|
//Change URL to new record
|
||||||
vm.obj = res.data;
|
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
|
||||||
//Change URL to new record
|
|
||||||
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
|
this.$router.push({
|
||||||
|
name: "inv-purchase-order",
|
||||||
|
params: {
|
||||||
|
recordid: res.data.id,
|
||||||
|
obj: res.data // Pass data object to new form
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.$router.push({
|
|
||||||
name: "project-edit",
|
|
||||||
params: {
|
|
||||||
recordid: res.data.id,
|
|
||||||
obj: res.data // Pass data object to new form
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
//PUT - only concurrency token is returned (**warning, if server changes object other fields then this needs to act more like POST above but is more efficient this way**)
|
|
||||||
//Handle "put" of an existing record (UPDATE)
|
|
||||||
vm.obj.concurrency = res.data.concurrency;
|
|
||||||
}
|
|
||||||
//Update the form status
|
//Update the form status
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: vm,
|
vm: vm,
|
||||||
|
|||||||
Reference in New Issue
Block a user