Merge branch 'dev' into 'staging'

fix: amo  build FieldsRule fild

See merge request frontend/squiz!344
This commit is contained in:
Nastya 2024-06-16 21:09:20 +00:00
commit b3dc7adeb7

@ -168,15 +168,19 @@ export const AmoCRMModal: FC<IntegrationsModalProps> = ({
TagsToAdd: selectedTags TagsToAdd: selectedTags
} }
const FieldsRule = {} as Record<Partial<QuestionKeys>, [{ QuestionID: QuestionID; }]>; const FieldsRule = {
for (let key in questionsBackend) { Company: [{ "QuestionID": {} }],
if (key !== "Contact") { Lead: [{ "QuestionID": {} }],
Customer: [{ "QuestionID": {} }],
};
if (questionsBackend[key as QuestionKeys] === null) FieldsRule[key as QuestionKeys] = [{ "QuestionID": {} }] console.log("selectedQuestions")
selectedQuestions[key as QuestionKeys].forEach((id) => { console.log(selectedQuestions)
FieldsRule[key as QuestionKeys][0].QuestionID[id] = 0 for (let key in FieldsRule) {
}) console.log("current key ", key)
} selectedQuestions[key as QuestionKeys].forEach((id) => {
FieldsRule[key as QuestionKeys][0].QuestionID[id] = 0
})
} }
for (let key in body.TagsToAdd) { for (let key in body.TagsToAdd) {
body.TagsToAdd[key as TagKeys] = body.TagsToAdd[key as TagKeys].map(id => Number(id)) body.TagsToAdd[key as TagKeys] = body.TagsToAdd[key as TagKeys].map(id => Number(id))