From 7dcdaff0ef38bafc29b18b4254062c5d6b268d31 Mon Sep 17 00:00:00 2001 From: Kevin Martinez Date: Mon, 22 Jan 2024 12:52:53 -0400 Subject: [PATCH] Add response data on form model save --- src/components/FormModel.vue | 2 +- src/pages/Route/Card/RouteForm.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 } }); } };