18 lines
709 B
TypeScript
18 lines
709 B
TypeScript
import type { ApolloClient } from '@apollo/client';
|
|
import { reaction } from 'mobx';
|
|
import type RootStore from 'stores/root';
|
|
import * as fillAgentsFromLead from '../lib/fill-agents-from-lead';
|
|
|
|
export default function commonReactions(store: RootStore, apolloClient: ApolloClient<object>) {
|
|
const { $calculation } = store;
|
|
reaction(
|
|
() => $calculation.getElementValue('selectLead'),
|
|
(leadid) => {
|
|
fillAgentsFromLead.fillIndAgent(store, apolloClient, leadid);
|
|
fillAgentsFromLead.fillCalcDoubleAgent(store, apolloClient, leadid);
|
|
fillAgentsFromLead.fillCalcBroker(store, apolloClient, leadid);
|
|
fillAgentsFromLead.fillFinDepartment(store, apolloClient, leadid);
|
|
}
|
|
);
|
|
}
|