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