diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 4ad566bf8..755cef77c 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -135,7 +135,7 @@ async function save() { } else { response = await axios.patch($props.urlUpdate || $props.url, body); } - emit('onDataSaved', formData.value, response); + emit('onDataSaved', formData.value, response?.data); originalData.value = JSON.parse(JSON.stringify(formData.value)); hasChanges.value = false; } catch (err) { diff --git a/src/pages/Route/Card/RouteForm.vue b/src/pages/Route/Card/RouteForm.vue index 49a067c00..5acbcff0e 100644 --- a/src/pages/Route/Card/RouteForm.vue +++ b/src/pages/Route/Card/RouteForm.vue @@ -71,8 +71,8 @@ const routeFilter = { }; const onSave = (data, response) => { if (isNew) { - axios.post(`Routes/${response.data?.id}/updateWorkCenter`); - router.push({ name: 'RouteSummary', params: { id: response.data?.id } }); + axios.post(`Routes/${response?.id}/updateWorkCenter`); + router.push({ name: 'RouteSummary', params: { id: response?.id } }); } };