fix radioDeliveryTime status reaction
This commit is contained in:
parent
d92f7ccebb
commit
0fccfc4932
@ -182,25 +182,25 @@ export function common({ store, apolloClient }: ProcessContext) {
|
||||
reaction(
|
||||
() => $calculation.$values.getValues(['leaseObjectUsed', 'subsidy', 'product', 'dealer']),
|
||||
async ({ leaseObjectUsed, subsidy, product: productId, dealer: dealerId }) => {
|
||||
if (!productId || !dealerId) {
|
||||
$calculation.element('radioDeliveryTime').unblock();
|
||||
let evo_baseproduct: CRMTypes.GetProductQuery['evo_baseproduct'] = null;
|
||||
let dealer: CRMTypes.GetDealerQuery['dealer'] = null;
|
||||
|
||||
return;
|
||||
if (productId) {
|
||||
const { data } = await apolloClient.query({
|
||||
query: CRMTypes.GetProductDocument,
|
||||
variables: { productId },
|
||||
});
|
||||
|
||||
({ evo_baseproduct } = data);
|
||||
}
|
||||
|
||||
const {
|
||||
data: { evo_baseproduct },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetProductDocument,
|
||||
variables: { productId },
|
||||
});
|
||||
|
||||
const {
|
||||
data: { dealer },
|
||||
} = await apolloClient.query({
|
||||
query: CRMTypes.GetDealerDocument,
|
||||
variables: { dealerId },
|
||||
});
|
||||
if (dealerId) {
|
||||
const { data } = await apolloClient.query({
|
||||
query: CRMTypes.GetDealerDocument,
|
||||
variables: { dealerId },
|
||||
});
|
||||
({ dealer } = data);
|
||||
}
|
||||
|
||||
if (
|
||||
leaseObjectUsed ||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user