diff --git a/src/composables/getRisk.js b/src/composables/getRisk.js deleted file mode 100644 index 566c74987..000000000 --- a/src/composables/getRisk.js +++ /dev/null @@ -1,23 +0,0 @@ -import axios from 'axios'; - -const method = { - supplier: 'SupplierRisks', - customer: 'ClientRisks', -}; -export async function getRisk(module, _filter) { - const filter = { - ..._filter, - include: { relation: 'company', scope: { fields: ['code'] } }, - }; - - return await axios(module, { - params: { filter: JSON.stringify(filter) }, - }); -} - -export async function getClientRisk(_filter) { - return await getRisk(method.customer, _filter); -} -export async function getSupplierRisk(_filter) { - return await getRisk(method.supplier, _filter); -} diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index c2700d79b..04ef5f882 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -170,7 +170,7 @@ onBeforeMount(() => { companyId.value = companyUser.value; }); -async function getRisks() { +async function getClientRisks() { const filter = { where: { clientFk: route.params.id, companyFk: companyUser.value }, }; @@ -180,7 +180,7 @@ async function getRisks() { } async function getCurrentBalance() { - const currentBalance = (await getRisks()).find((balance) => { + const currentBalance = (await getClientRisks()).find((balance) => { return balance.companyFk === companyId.value; }); return currentBalance && currentBalance.amount;