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