change some keys
This commit is contained in:
parent
1545742950
commit
a95df3debb
|
|
@ -29,7 +29,7 @@ const FilterForm = () => {
|
|||
|
||||
const grade_id = formik.values.grade_id?.id
|
||||
const subject_id = formik.values?.subject_id?.id
|
||||
const unit_id = formik.values?.unit_id?.id
|
||||
const unitId = formik.values?.unitId?.id
|
||||
const lessonsIds = formik.values?.lessonsIds?.map((lesson:any) => lesson.id)
|
||||
|
||||
const { data: Grade, isLoading: isLoadingGrade } = useGetAllGrade({
|
||||
|
|
@ -54,7 +54,7 @@ const FilterForm = () => {
|
|||
const canChangeSubjectPage = !!Subject?.links?.next;
|
||||
const SubjectPage = Subject?.meta?.current_page;
|
||||
|
||||
/// unit_id
|
||||
/// unitId
|
||||
const { data: Unit, isLoading: isLoadingUnit } = useGetAllUnit({
|
||||
name: UnitName,
|
||||
page: UnitCurrentPage,
|
||||
|
|
@ -75,11 +75,11 @@ const FilterForm = () => {
|
|||
name: LessonName,
|
||||
page: LessonCurrentPage,
|
||||
grade_id,
|
||||
unit_id
|
||||
unitId
|
||||
|
||||
},
|
||||
{
|
||||
enabled: !!grade_id || !!unit_id
|
||||
enabled: !!grade_id || !!unitId
|
||||
}
|
||||
);
|
||||
const LessonOption = Lesson?.data ?? [];
|
||||
|
|
@ -93,7 +93,7 @@ const FilterForm = () => {
|
|||
lessonsIds,
|
||||
grade_id,
|
||||
subject_id,
|
||||
unit_id
|
||||
unitId
|
||||
});
|
||||
|
||||
const TagOption = Tag?.data ?? [];
|
||||
|
|
@ -132,7 +132,7 @@ const FilterForm = () => {
|
|||
dependensValue:subject_id,
|
||||
props: {
|
||||
searchBy: "UnitName",
|
||||
name: "unit_id",
|
||||
name: "unitId",
|
||||
label: "unit",
|
||||
type: "Search",
|
||||
option: UnitOption,
|
||||
|
|
@ -146,7 +146,7 @@ const FilterForm = () => {
|
|||
const colLeft :any=[
|
||||
|
||||
{
|
||||
dependensValue: unit_id,
|
||||
dependensValue: unitId,
|
||||
props: {
|
||||
searchBy: "LessonName",
|
||||
name: "lessonsIds",
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const App: React.FC = () => {
|
|||
tagsIds: ConvertArrayToArrayOfIds(filterState?.tagsIds),
|
||||
grade_id: filterState?.grade_id?.id,
|
||||
subject_id: filterState?.subject_id?.id,
|
||||
unit_id: filterState?.unit_id?.id,
|
||||
unitId: filterState?.unitId?.id,
|
||||
lessonsIds: ConvertArrayToArrayOfIds(filterState?.lessonsIds),
|
||||
content: Filter?.content,
|
||||
hasAnswer: Filter?.hasAnswer,
|
||||
|
|
|
|||
|
|
@ -11,11 +11,12 @@ import { toast } from "react-toastify";
|
|||
import MainInputs from "./components/MainInputs";
|
||||
import Questions from "./components/Questions";
|
||||
import useUnsavedChangesWarning from "../../../../../Hooks/useUnsavedChangesWarning";
|
||||
import { uid } from "../../../../../utils/reOrder";
|
||||
|
||||
const Form = () => {
|
||||
const formik = useFormikContext<any>();
|
||||
const { setSuccess, Success, ShowHint } = useObjectToEdit();
|
||||
|
||||
|
||||
const handleAddChoice = (
|
||||
parent_index: number,
|
||||
fromKeyCombination: boolean = false,
|
||||
|
|
@ -46,9 +47,10 @@ const Form = () => {
|
|||
image: "",
|
||||
parent: "",
|
||||
isBase: 0,
|
||||
id:uid(),
|
||||
// max_mark: 1,
|
||||
// min_mark_to_pass: 1,
|
||||
answers: [{ answer: null, answer_image: null, isCorrect: 0 }],
|
||||
answers: [{id:uid(), answer: null, answer_image: null, isCorrect: 0 ,content_image:null}],
|
||||
tags: [],
|
||||
},
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user