From e1ef6f87f3f4c334d3e7f65cb6fc8617bf67dc24 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 24 Mar 2025 14:01:43 +0100 Subject: [PATCH] feat: implement onBeforeSave function to handle form data updates --- src/pages/Claim/Card/ClaimBasicData.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index 43941d1dc..7e7d42ae8 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -2,6 +2,7 @@ import { ref } from 'vue'; import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; +import { getDifferences, getUpdatedValues } from 'src/filters'; import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelectEnum from 'src/components/common/VnSelectEnum.vue'; import FetchData from 'components/FetchData.vue'; @@ -9,12 +10,18 @@ import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; - import VnAvatar from 'src/components/ui/VnAvatar.vue'; const route = useRoute(); const { t } = useI18n(); const workersOptions = ref([]); + +function onBeforeSave(formData, originalData) { + return getUpdatedValues( + Object.keys(getDifferences(formData, originalData)), + formData, + ); +}