This commit is contained in:
2021-03-07 22:32:46 +00:00
parent fd9232ffa7
commit b292c3e134
2 changed files with 19 additions and 14 deletions

View File

@@ -1071,6 +1071,7 @@
:allow-no-selection="false"
:can-clear="false"
:aya-type="ayaTypes().ServiceRate"
:variant="'contractrates'"
:show-edit-icon="true"
v-model="
obj.serviceRateItems[editServiceRateItemIndex]
@@ -1532,25 +1533,21 @@ export default {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
} else {
//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.data.id) {
//POST - whole new object returned
//POST or PUT - whole new object returned which is a little different than other objects
//so if it's new then need to navigate to it to update url with id
if (vm.$route.params.recordid != 0) {
//update of existing record
vm.obj = res.data;
//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()
} else {
this.$router.push({
name: "contract-edit",
params: {
recordid: res.data.id,
obj: res.data // Pass data object to new form
obj: res.data // Pass data object to new form will prevent fetch
}
});
} 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
window.$gz.form.setFormState({
vm: vm,