From f703524425e38c427ae00134da02178d08ce9162 Mon Sep 17 00:00:00 2001 From: Chika Date: Tue, 18 Jan 2022 00:14:18 +0300 Subject: [PATCH] add for prev commit: ef9f340 --- .../CalculationStore/Effects/reactions/gibddReactions.ts | 4 ++-- .../Effects/reactions/loadKpReaction/index.ts | 2 +- .../CalculationStore/Effects/reactions/requestReactions.ts | 5 ++++- src/client/stores/CalculationStore/init/requests.ts | 5 ++++- src/core/services/CrmService/index.ts | 5 ++--- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/client/stores/CalculationStore/Effects/reactions/gibddReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/gibddReactions.ts index 9eee9ac..5cf9b5a 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/gibddReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/gibddReactions.ts @@ -465,7 +465,7 @@ const gibddReactions: IReactionEffect[] = [ if (evo_city_fias_id) { CrmService.getCRMEntities<'evo_town', IEvoTown>({ query: gql` - query selectLegalClientTown($evo_fias_id: String) { + query legalClientTown($evo_fias_id: String) { evo_town(evo_fias_id: $evo_fias_id) { evo_fias_id evo_townid @@ -568,7 +568,7 @@ const gibddReactions: IReactionEffect[] = [ if (evo_city_fias_id && objectRegistration === 100000000) { CrmService.getCRMEntities<'evo_town', IEvoTown>({ query: gql` - query selectTownRegistration($evo_fias_id: String) { + query townRegistration($evo_fias_id: String) { evo_town(evo_fias_id: $evo_fias_id) { evo_fias_id evo_townid diff --git a/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts b/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts index 3f8e4d1..119f0b0 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts @@ -393,7 +393,7 @@ const loadKpReaction: IReactionEffect = calculationStore => ({ const secondaryOptions = await CrmService.getCRMOptions< ElementsNames, - keyof IEvoTown + IEvoTown >({ query: getSecondaryOptionsForQuote, variables: { diff --git a/src/client/stores/CalculationStore/Effects/reactions/requestReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/requestReactions.ts index 5b338e1..8add992 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/requestReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/requestReactions.ts @@ -297,7 +297,10 @@ export default [ ); if (indAgentId && !calculationProcess.hasProcess(Process.LoadKp)) - CrmService.getCRMOptions<'evo_reward_conditions'>({ + CrmService.getCRMOptions< + 'evo_reward_conditions', + IEvoRewardCondition + >({ query: gql` query selectIndAgentRewardCondition( $statecode: Int diff --git a/src/client/stores/CalculationStore/init/requests.ts b/src/client/stores/CalculationStore/init/requests.ts index cabb2a9..e96d592 100644 --- a/src/client/stores/CalculationStore/init/requests.ts +++ b/src/client/stores/CalculationStore/init/requests.ts @@ -26,7 +26,10 @@ import { } from './variables'; export function composeRequests() { - const mainOptionsRequest = CrmService.getCRMOptions({ + const mainOptionsRequest = CrmService.getCRMOptions< + ElementsNames, + TCRMEntity + >({ query: getMainOptionsQuery, variables: mainOptionsVariables, }); diff --git a/src/core/services/CrmService/index.ts b/src/core/services/CrmService/index.ts index 88c17d7..f6031e4 100644 --- a/src/core/services/CrmService/index.ts +++ b/src/core/services/CrmService/index.ts @@ -2,8 +2,7 @@ import { QueryOptions } from '@apollo/client'; import axios from 'axios'; import { CRM_PROXY_URL } from 'core/constants/urls'; import GQLClient from 'core/graphql/client'; -import { ElementsNames } from 'core/types/Calculation/Store/elements'; -import { IQuote, TCRMEntity } from 'core/types/Entities/crmEntities'; +import { IQuote } from 'core/types/Entities/crmEntities'; import { optionizeEntities } from './tools/entity'; export default class { @@ -19,7 +18,7 @@ export default class { >(queryOptions).then(res => res.data); } - public static getCRMOptions( + public static getCRMOptions( queryOptions: QueryOptions< Partial> | Record, Record