From 7d84dd8c68f7bc9f291fde9bf4089dda6c963547 Mon Sep 17 00:00:00 2001 From: taro Date: Tue, 15 Apr 2025 23:43:18 -0300 Subject: [PATCH] refactor(ConfirmView): use Salix in `getTransferAccounts` --- src/pages/Ecomerce/ConfirmView.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/pages/Ecomerce/ConfirmView.vue b/src/pages/Ecomerce/ConfirmView.vue index d1215722..2b89d3c0 100644 --- a/src/pages/Ecomerce/ConfirmView.vue +++ b/src/pages/Ecomerce/ConfirmView.vue @@ -13,6 +13,7 @@ import { useQuasar } from 'quasar'; const $q = useQuasar(); const jApi = inject('jApi'); +const api = inject('api'); const { notify } = useNotify(); const { t } = useI18n(); const appStore = useAppStore(); @@ -154,8 +155,15 @@ const getOrder = async () => { const getTransferAccounts = async () => { try { - const data = await jApi.query(`SELECT name, iban FROM mainAccountBank`); - transferAccounts.value = data; + const filter = { + include: [ + { relation: 'account', scope: { include: [ 'bankEntity' ]} } , + ], + }; + const { data: mainAccountData } = await api.get('MainAccounts', { + params: { filter: JSON.stringify(filter) }, + }); + transferAccounts.value = mainAccountData; } catch (error) { console.error(error); } @@ -297,12 +305,12 @@ onMounted(async () => { -
{{ account.name }}
-
{{ account.iban }}
+
{{ transferAccount.account.bankEntity.name }}
+
{{ transferAccount.account.iban }}