forked from verdnatura/salix-front
Add response data on form model save
This commit is contained in:
parent
3fc1bff213
commit
7dcdaff0ef
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue