From ebbc41352d9480a29e030a2307c28bf6f2475d47 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 23 Feb 2021 00:37:39 +0000 Subject: [PATCH] --- ayanova/src/views/inv-purchase-order.vue | 30 ++++++++++-------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/ayanova/src/views/inv-purchase-order.vue b/ayanova/src/views/inv-purchase-order.vue index d868dc3c..2b67eea6 100644 --- a/ayanova/src/views/inv-purchase-order.vue +++ b/ayanova/src/views/inv-purchase-order.vue @@ -946,25 +946,19 @@ 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 - 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() + //POST or PUT - whole new object returned + 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() + + 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 window.$gz.form.setFormState({ vm: vm,