0
0
Fork 0

Add response data on form model save

This commit is contained in:
Kevin Martinez 2024-01-22 12:52:53 -04:00
parent 3fc1bff213
commit 7dcdaff0ef
2 changed files with 3 additions and 3 deletions

View File

@ -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) {

View File

@ -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 } });
}
};
</script>