add filter lessonsIds
This commit is contained in:
parent
0b827ba990
commit
091c0bf15c
|
|
@ -66,6 +66,7 @@ export const useColumns = () => {
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|
||||||
render: (_text, record, index) => {
|
render: (_text, record, index) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ActionButtons
|
<ActionButtons
|
||||||
canDelete={canDeleteQuestion}
|
canDelete={canDeleteQuestion}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ const App: React.FC = () => {
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
|
|
||||||
const response = useGetAllQuestion({
|
const response = useGetAllQuestion({
|
||||||
lesson_id: lesson_id,
|
lessonsIds: [lesson_id],
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,5 @@
|
||||||
import React, { useEffect, useState } from "react";
|
import { Form, useFormikContext } from "formik";
|
||||||
import { Form, Field, useFormikContext } from "formik";
|
|
||||||
import Image from "../../Components/Ui/Image";
|
|
||||||
import { Input } from "antd";
|
|
||||||
import AuthSelect from "../../Components/Ui/Custom/AuthSelect";
|
|
||||||
// import { useGetAllCycle } from "../../api/cycle";
|
|
||||||
// import { useGetAllBranch } from "../../api/branch";
|
|
||||||
import { useGetAllTerm } from "../../api/term";
|
|
||||||
import { FormValues } from "../../types/Auth";
|
|
||||||
import {
|
|
||||||
BRANCH_OBJECT_KEY,
|
|
||||||
CYCLE_OBJECT_KEY,
|
|
||||||
TERM_OBJECT_KEY,
|
|
||||||
} from "../../config/AppKey";
|
|
||||||
import useFormatAuthDataToSelect from "../../utils/useFormatAuthDataToSelect";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import ValidationField from "../../Components/ValidationField/ValidationField";
|
import ValidationField from "../../Components/ValidationField/ValidationField";
|
||||||
|
|
||||||
|
|
@ -22,6 +9,9 @@ type FormFieldType = {
|
||||||
|
|
||||||
const FormField = ({ isLoading }: FormFieldType) => {
|
const FormField = ({ isLoading }: FormFieldType) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
const {isValid} = useFormikContext();
|
||||||
|
console.log(isValid,"isValid");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form className="AuthForm">
|
<Form className="AuthForm">
|
||||||
{/* <Image style={{background:"#000"}} src="../App/Logo.png" /> */}
|
{/* <Image style={{background:"#000"}} src="../App/Logo.png" /> */}
|
||||||
|
|
@ -45,7 +35,7 @@ const FormField = ({ isLoading }: FormFieldType) => {
|
||||||
/>
|
/>
|
||||||
</div> */}
|
</div> */}
|
||||||
|
|
||||||
<button disabled={isLoading} type="submit" className="auth_submit_button">
|
<button disabled={ !isValid || isLoading} type="submit" className="auth_submit_button">
|
||||||
{t("practical.login")}
|
{t("practical.login")}
|
||||||
</button>
|
</button>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ const LoginForm = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="LoginForm">
|
<div className="LoginForm">
|
||||||
<Formik initialValues={initialValues} onSubmit={handelSubmit} validationSchema={validationSchema} >
|
<Formik initialValues={initialValues} onSubmit={handelSubmit} isInitialValid={false} validationSchema={validationSchema} >
|
||||||
{(formikProps) => <FormField isLoading={isLoading} />}
|
{(formikProps) => <FormField isLoading={isLoading} />}
|
||||||
</Formik>
|
</Formik>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,4 @@ const API = {
|
||||||
LOGIN: `login`,
|
LOGIN: `login`,
|
||||||
LOGOUT: `logout`,
|
LOGOUT: `logout`,
|
||||||
};
|
};
|
||||||
export const useLoginAdmin = () => useAddMutation(KEY, API.LOGIN, false);
|
export const useLoginAdmin = () => useAddMutation(KEY, API.LOGIN, true);
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,8 @@ function useAxios() {
|
||||||
return response;
|
return response;
|
||||||
},
|
},
|
||||||
function (error) {
|
function (error) {
|
||||||
|
console.log(error?.response);
|
||||||
|
|
||||||
const status = error?.request?.status;
|
const status = error?.request?.status;
|
||||||
const errorMsg = error?.response?.data?.message;
|
const errorMsg = error?.response?.data?.message;
|
||||||
const errorField = error?.response?.data;
|
const errorField = error?.response?.data;
|
||||||
|
|
|
||||||
|
|
@ -754,7 +754,7 @@
|
||||||
"param": "معامل",
|
"param": "معامل",
|
||||||
"student_package": "حزمة الطالب",
|
"student_package": "حزمة الطالب",
|
||||||
"quiz":"الاختبارات",
|
"quiz":"الاختبارات",
|
||||||
"QuestionBank":"بنك الأسئلة"
|
"questionBank":"بنك الأسئلة"
|
||||||
},
|
},
|
||||||
"message": {
|
"message": {
|
||||||
"some_thing_went_wrong": "حدث خطأ ما",
|
"some_thing_went_wrong": "حدث خطأ ما",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user