This commit is contained in:
2021-05-13 23:35:10 +00:00
parent 1cf4f90fd6
commit 881564f1b8
5 changed files with 38 additions and 10 deletions

View File

@@ -916,8 +916,7 @@ async function saveLabors(vm, woItemIndex) {
for (let i = 0; i < vm.obj.items[woItemIndex].labors.length; i++) {
let o = vm.obj.items[woItemIndex].labors[i];
if (o.isDirty) {
const isPost = o.id == 0;
let res = await window.$gz.api.upsert(`${API_BASE_URL}items/labors`, o);
const res = await window.$gz.api.upsert(`${API_BASE_URL}items/labors`, o);
if (res.error) {
handleSaveError(vm, {
error: res.error,
@@ -927,9 +926,7 @@ async function saveLabors(vm, woItemIndex) {
});
} else {
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
vm.obj.items[woItemIndex].labors.splice(i, 1, res.data); //vue needs the splice to trigger reactivity or else the UI won't update
//vm.obj.items[woItemIndex].labors[i] = res.data;
vm.obj.items[woItemIndex].labors.splice(i, 1, res.data); //vue needs the splice rather than just setting the value in order to trigger reactivity or else the UI won't update
}
}
}