fix createResult calls params
This commit is contained in:
parent
0c7ed71d3d
commit
7a91c0f953
@ -6,6 +6,7 @@ import {
|
|||||||
} from "@root/questions/actions";
|
} from "@root/questions/actions";
|
||||||
import { updateRootContentId } from "@root/quizes/actions";
|
import { updateRootContentId } from "@root/quizes/actions";
|
||||||
import { useCurrentQuiz } from "@root/quizes/hooks";
|
import { useCurrentQuiz } from "@root/quizes/hooks";
|
||||||
|
import { useQuizStore } from "@root/quizes/store";
|
||||||
import {
|
import {
|
||||||
setOpenedModalQuestions,
|
setOpenedModalQuestions,
|
||||||
updateOpenedModalSettingsId,
|
updateOpenedModalSettingsId,
|
||||||
@ -41,7 +42,7 @@ export const FirstNodeField = () => {
|
|||||||
dragQuestionContentId,
|
dragQuestionContentId,
|
||||||
(question) => (question.content.rule.parentId = "root"),
|
(question) => (question.content.rule.parentId = "root"),
|
||||||
);
|
);
|
||||||
createResult(dragQuestionContentId);
|
createResult(useQuizStore.getState().editQuizId, dragQuestionContentId);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
enqueueSnackbar("Нет информации о взятом опроснике");
|
enqueueSnackbar("Нет информации о взятом опроснике");
|
||||||
@ -65,7 +66,10 @@ export const FirstNodeField = () => {
|
|||||||
modalQuestionTargetContentId,
|
modalQuestionTargetContentId,
|
||||||
(question) => (question.content.rule.parentId = "root"),
|
(question) => (question.content.rule.parentId = "root"),
|
||||||
);
|
);
|
||||||
createResult(modalQuestionTargetContentId);
|
createResult(
|
||||||
|
useQuizStore.getState().editQuizId,
|
||||||
|
modalQuestionTargetContentId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
enqueueSnackbar("Нет информации о взятом опроснике");
|
enqueueSnackbar("Нет информации о взятом опроснике");
|
||||||
|
@ -11,6 +11,7 @@ import {
|
|||||||
updateQuestion,
|
updateQuestion,
|
||||||
} from "@root/questions/actions";
|
} from "@root/questions/actions";
|
||||||
import { useQuestionsStore } from "@root/questions/store";
|
import { useQuestionsStore } from "@root/questions/store";
|
||||||
|
import { useQuizStore } from "@root/quizes/store";
|
||||||
import { updateOpenedModalSettingsId } from "@root/uiTools/actions";
|
import { updateOpenedModalSettingsId } from "@root/uiTools/actions";
|
||||||
import { useUiTools } from "@root/uiTools/store";
|
import { useUiTools } from "@root/uiTools/store";
|
||||||
import { NodeSingular, PresetLayoutOptions } from "cytoscape";
|
import { NodeSingular, PresetLayoutOptions } from "cytoscape";
|
||||||
@ -196,7 +197,7 @@ export function clearDataAfterRemoveNode({
|
|||||||
q.content.usage = true;
|
q.content.usage = true;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
createResult(parentQuestionContentId);
|
createResult(useQuizStore.getState().editQuizId, parentQuestionContentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
//чистим rule родителя
|
//чистим rule родителя
|
||||||
@ -338,7 +339,7 @@ export const addNode = ({
|
|||||||
|
|
||||||
if (Object.keys(targetQuestion).length !== 0 && parentNodeContentId) {
|
if (Object.keys(targetQuestion).length !== 0 && parentNodeContentId) {
|
||||||
clearDataAfterAddNode({ parentNodeContentId, targetQuestion });
|
clearDataAfterAddNode({ parentNodeContentId, targetQuestion });
|
||||||
createResult(targetQuestion.content.id);
|
createResult(useQuizStore.getState().editQuizId, targetQuestion.content.id);
|
||||||
} else {
|
} else {
|
||||||
enqueueSnackbar("Добавляемый вопрос не найден");
|
enqueueSnackbar("Добавляемый вопрос не найден");
|
||||||
}
|
}
|
||||||
|
@ -631,7 +631,10 @@ export const clearRuleForAll = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createResult = async (quizId: number, parentContentId?: string) =>
|
export const createResult = async (
|
||||||
|
quizId: number | null,
|
||||||
|
parentContentId?: string,
|
||||||
|
) =>
|
||||||
requestQueue.enqueue(async () => {
|
requestQueue.enqueue(async () => {
|
||||||
if (!quizId || !parentContentId) {
|
if (!quizId || !parentContentId) {
|
||||||
console.error(
|
console.error(
|
||||||
|
Loading…
Reference in New Issue
Block a user