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 {
|
} 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) {
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue