From 179be134880c42c87816cfe612bc2fc59fc67cb8 Mon Sep 17 00:00:00 2001 From: Nastya Date: Tue, 11 Jun 2024 22:52:20 +0300 Subject: [PATCH] new hard model amo --- .../IntegrationsModal/AmoCRMModal.tsx | 59 +++++++++++++++---- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/src/pages/IntegrationsPage/IntegrationsModal/AmoCRMModal.tsx b/src/pages/IntegrationsPage/IntegrationsModal/AmoCRMModal.tsx index 3d3cf7b3..0fed0ff8 100644 --- a/src/pages/IntegrationsPage/IntegrationsModal/AmoCRMModal.tsx +++ b/src/pages/IntegrationsPage/IntegrationsModal/AmoCRMModal.tsx @@ -107,9 +107,9 @@ export const AmoCRMModal: FC = ({ } if (settingsResponse) { console.log(settingsResponse); - setFirstRules(false); + setFirstRules(false); } - + }; fetchAccount(); @@ -130,12 +130,30 @@ export const AmoCRMModal: FC = ({ PipelineID: selectedPipeline, StepID: selectedStep, Fieldsrule: { - ...questionEntity + Lead: [ + { + QuestionID: { + "44300": 0, + } + } + ], + Company: [ + { + QuestionID: { + } + } + ], + Customer: [ + { + QuestionID: { + } + } + ] }, TagsToAdd: { ...tags } - }) + }) if (quizID === undefined) return if (selectedPipeline?.toString().length === 0) return enqueueSnackbar("Выберите воронку") if (selectedPipeline?.toString().length === 0) return enqueueSnackbar("Выберите этап воронки") @@ -146,7 +164,26 @@ export const AmoCRMModal: FC = ({ PipelineID: Number(selectedPipeline), StepID: Number(selectedStep), Fieldsrule: { - ...questionEntity + Lead: [ + { + QuestionID: { + "44300": 0, + } + } + ], + Company: [ + { + QuestionID: { + } + } + ], + Customer: [ + { + QuestionID: { + } + } + ] + }, TagsToAdd: { ...tags @@ -155,12 +192,12 @@ export const AmoCRMModal: FC = ({ } else { const body = { - Fieldsrule: { - ...questionEntity - }, - TagsToAdd: { - ...tags - } + Fieldsrule: { + ...questionEntity + }, + TagsToAdd: { + ...tags + } }; if (selectedDealPerformer?.toString() > 0) body.PerformerID = Number(selectedDealPerformer) if (selectedPipeline?.toString() > 0) body.PipelineID = Number(selectedPipeline)