fix regions

This commit is contained in:
vchikalkin 2023-04-18 17:40:37 +03:00
parent 3269a499db
commit 28d99c15b4

View File

@ -389,12 +389,10 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
return;
}
const quote = $calculation.element('selectQuote').getValue();
const legalRegionId = await getLegalRegion({
lead,
opportunity,
quote,
quote: null,
});
if (legalRegionId) {
$calculation.element('selectLegalClientRegion').setValue(legalRegionId).block();
@ -405,7 +403,7 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
const regionId = await getRegion({
lead,
opportunity,
quote,
quote: null,
});
if (regionId) {
$calculation.element('selectRegionRegistration').setValue(regionId).block();
@ -418,7 +416,8 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
}
);
reaction(
disposableReaction(
() => $process.has('LoadKP'),
() => $calculation.element('selectLegalClientRegion').getValue(),
async (regionId) => {
if (!regionId) {
@ -429,12 +428,11 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
const lead = $calculation.element('selectLead').getValue();
const opportunity = $calculation.element('selectOpportunity').getValue();
const quote = $calculation.element('selectQuote').getValue();
const townId = await getLegalTown({
lead,
opportunity,
quote,
quote: null,
regionId,
});
if (townId) {
@ -456,12 +454,11 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
const lead = $calculation.element('selectLead').getValue();
const opportunity = $calculation.element('selectOpportunity').getValue();
const quote = $calculation.element('selectQuote').getValue();
const townId = await getTown({
lead,
opportunity,
quote,
quote: null,
regionId,
});