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 { } else {
response = await axios.patch($props.urlUpdate || $props.url, body); 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)); originalData.value = JSON.parse(JSON.stringify(formData.value));
hasChanges.value = false; hasChanges.value = false;
} catch (err) { } catch (err) {

View File

@ -71,8 +71,8 @@ const routeFilter = {
}; };
const onSave = (data, response) => { const onSave = (data, response) => {
if (isNew) { if (isNew) {
axios.post(`Routes/${response.data?.id}/updateWorkCenter`); axios.post(`Routes/${response?.id}/updateWorkCenter`);
router.push({ name: 'RouteSummary', params: { id: response.data?.id } }); router.push({ name: 'RouteSummary', params: { id: response?.id } });
} }
}; };
</script> </script>