process/agents: fix vscode apollo extension crash

This commit is contained in:
Chika 2022-10-24 18:21:05 +03:00
parent b78d7002a2
commit 4ae1212a65
3 changed files with 13 additions and 18 deletions

View File

@ -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),

View 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
}
}
`;

View File

@ -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) => {