process/agents: fix vscode apollo extension crash
This commit is contained in:
parent
b78d7002a2
commit
4ae1212a65
@ -5,6 +5,7 @@ import type { Elements } from 'Components/Calculation/config/map/values';
|
||||
import type { GetAgentQuery, GetAgentQueryVariables } from 'graphql/crm.types';
|
||||
import type RootStore from 'stores/root';
|
||||
import { normalizeOptions } from 'tools/entity';
|
||||
import { QUERY_GET_AGENT } from './query';
|
||||
|
||||
function makeFillAgentFromLead(
|
||||
elementName: Elements,
|
||||
@ -51,15 +52,6 @@ function makeFillAgentFromLead(
|
||||
};
|
||||
}
|
||||
|
||||
const QUERY_GET_AGENT = gql`
|
||||
query GetAgent($agentid: Uuid!) {
|
||||
agent: account(accountid: $agentid) {
|
||||
label: name
|
||||
value: accountid
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* Если lead содержит данные,
|
||||
* то indAgent заполняется ссылкой на карточку Контрагент (account),
|
||||
|
||||
11
process/agents/lib/query.ts
Normal file
11
process/agents/lib/query.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
export const QUERY_GET_AGENT = gql`
|
||||
query GetAgent($agentid: Uuid!) {
|
||||
agent: account(accountid: $agentid) {
|
||||
label: name
|
||||
value: accountid
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -8,6 +8,7 @@ import { reaction } from 'mobx';
|
||||
import type RootStore from 'stores/root';
|
||||
import { normalizeOptions } from 'tools/entity';
|
||||
import * as fillAgentsFromLead from '../lib/fill-agents-from-lead';
|
||||
import { QUERY_GET_AGENT } from '../lib/query';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
@ -84,15 +85,6 @@ export default function commonReactions(store: RootStore, apolloClient: ApolloCl
|
||||
}
|
||||
`;
|
||||
|
||||
const QUERY_GET_AGENT = gql`
|
||||
query GetAgent($agentid: Uuid!) {
|
||||
agent: account(accountid: $agentid) {
|
||||
label: name
|
||||
value: accountid
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
reaction(
|
||||
() => $calculation.getElementValue('selectDealerPerson'),
|
||||
async (dealerPersonId) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user