From dcfc5f87c1d3f6fb112647aad17759d50d0f33c6 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 10 Jul 2023 06:04:05 +0200 Subject: [PATCH] refs #5930 mod component --- src/components/FormModel.vue | 6 +++++- src/composables/getUrl.js | 13 ++++--------- src/pages/Claim/Card/ClaimBasicData.vue | 14 +++++++++++++- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 0a4580289..9d0916a8e 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -25,6 +25,10 @@ const $props = defineProps({ type: Object, default: null, }, + urlUpdate: { + type: String, + default: null, + }, }); const emit = defineEmits(['onFetch']); @@ -66,7 +70,7 @@ async function save() { }); } isLoading.value = true; - await axios.patch($props.url, formData.value); + await axios.patch($props.urlUpdate || $props.url, formData.value); originalData.value = formData.value; hasChanges.value = false; diff --git a/src/composables/getUrl.js b/src/composables/getUrl.js index 63eb63c0b..e020d7f18 100644 --- a/src/composables/getUrl.js +++ b/src/composables/getUrl.js @@ -2,18 +2,13 @@ import axios from 'axios'; export async function getUrl(route, appName = 'salix') { let url; - const env = process.env.NODE_ENV === 'development' ? 'dev' : process.env.NODE_ENV; const filter = { - where: {and: [ - {appName: appName}, - {environment: env} - ]} + where: { and: [{ appName: appName }, { environment: process.env.NODE_ENV }] }, }; - await axios.get('Urls/findOne', {params: {filter}}) - .then(res => { - url = res.data.url + route; - }); + await axios.get('Urls/findOne', { params: { filter } }).then((res) => { + url = res.data.url + route; + }); return url; } diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index 87a5dd8bb..ddf669dd0 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -13,6 +13,16 @@ const session = useSession(); const token = session.getToken(); const claimFilter = { + fields: [ + 'id', + 'clientFk', + 'created', + 'workerFk', + 'claimStateFk', + 'packages', + 'rma', + 'hasToPickUp', + ], include: [ { relation: 'client', @@ -85,6 +95,7 @@ const statesFilter = { @@ -180,9 +191,10 @@ const statesFilter = {