Merge branch 'dev' into 'staging'
fix: amo build FieldsRule fild See merge request frontend/squiz!344
This commit is contained in:
commit
b3dc7adeb7
@ -168,15 +168,19 @@ export const AmoCRMModal: FC<IntegrationsModalProps> = ({
|
||||
TagsToAdd: selectedTags
|
||||
}
|
||||
|
||||
const FieldsRule = {} as Record<Partial<QuestionKeys>, [{ QuestionID: QuestionID; }]>;
|
||||
for (let key in questionsBackend) {
|
||||
if (key !== "Contact") {
|
||||
const FieldsRule = {
|
||||
Company: [{ "QuestionID": {} }],
|
||||
Lead: [{ "QuestionID": {} }],
|
||||
Customer: [{ "QuestionID": {} }],
|
||||
};
|
||||
|
||||
if (questionsBackend[key as QuestionKeys] === null) FieldsRule[key as QuestionKeys] = [{ "QuestionID": {} }]
|
||||
selectedQuestions[key as QuestionKeys].forEach((id) => {
|
||||
FieldsRule[key as QuestionKeys][0].QuestionID[id] = 0
|
||||
})
|
||||
}
|
||||
console.log("selectedQuestions")
|
||||
console.log(selectedQuestions)
|
||||
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) {
|
||||
body.TagsToAdd[key as TagKeys] = body.TagsToAdd[key as TagKeys].map(id => Number(id))
|
||||
|
Loading…
Reference in New Issue
Block a user