This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user