перевод имён вопросов в амо модалке
This commit is contained in:
parent
c9d7da58f4
commit
cf3b60e19f
@ -20,7 +20,7 @@ interface Props {
|
|||||||
isModalOpen: boolean;
|
isModalOpen: boolean;
|
||||||
isTryRemoveAccount: boolean;
|
isTryRemoveAccount: boolean;
|
||||||
quizID: number;
|
quizID: number;
|
||||||
questions: AnyTypedQuizQuestion
|
questions: AnyTypedQuizQuestion[]
|
||||||
}
|
}
|
||||||
|
|
||||||
const FCTranslate = {
|
const FCTranslate = {
|
||||||
@ -151,6 +151,22 @@ export const useAmoIntegration = ({ isModalOpen, isTryRemoveAccount, quizID, que
|
|||||||
|
|
||||||
}, [isModalOpen, isTryRemoveAccount]);
|
}, [isModalOpen, isTryRemoveAccount]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const transletedQuestions = {}
|
||||||
|
|
||||||
|
Object.keys(selectedQuestions).forEach((column) => {
|
||||||
|
selectedQuestions[column].forEach((minifiedData) => {
|
||||||
|
const q = questions.find(e => e.backendId === Number(minifiedData.id)) || {}
|
||||||
|
transletedQuestions[column] = {
|
||||||
|
...minifiedData,
|
||||||
|
title: q.title || transletedQuestions[column].title
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
setSelectedQuestions(transletedQuestions)
|
||||||
|
}, [questions])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getPipelines({
|
getPipelines({
|
||||||
page: pageOfPipelines,
|
page: pageOfPipelines,
|
||||||
|
Loading…
Reference in New Issue
Block a user