fix: refs #7134 remove risk
This commit is contained in:
parent
a8e1bdc684
commit
252dd21492
|
@ -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);
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue