Commit 007a3ac8 authored by janithgamage1.ed's avatar janithgamage1.ed

fix: update

desc : update project
parent 8ee0496c
......@@ -67,8 +67,6 @@ export const JWTProvider = ({ children }: { children: React.ReactElement }) => {
const response = await axiosServices.get('/rest_node/user/current-user');
const { user } = response.data;
console.log(user);
dispatch({
type: LOGIN,
payload: {
......
// material-ui
import useAuth from "hooks/useAuth";
import { useEffect } from "react";
// project import
// ==============================|| Dashboard ||============================== //
const Dashboard = () => {
const { user } = useAuth()
// const serviceToken = window.localStorage.getItem('serviceToken');
// useEffect(() => {
// const fetchData = async () => {
// try {
// // Set the token in your Axios instance for future requests
// axiosServices.defaults.headers.common['Authorization'] = `Bearer ${serviceToken}`;
// // Make the API request
// const response = await axiosServices.get('/rest_node/user/current-user');
// const { user } = response.data;
// console.log(user);
// console.log(response);
// // Handle the user data or dispatch it to your state here
// } catch (error) {
// // Handle errors here (e.g., token expiration, network issues)
// console.error('Error fetching user data:', error);
// // You can dispatch a logout action or handle the error accordingly
// }
// };
// fetchData();
// }, [])
useEffect(() => {
console.log(user?.id);
}, [user])
const Dashboard = () => {
return (
<>
......
......@@ -205,8 +205,6 @@ const Tutorial = () => {
const file = new File([blob], 'image.jpg', { type: 'image/jpeg' });
console.log(file);
dispatch(CalculateMarks(curriculumIndex, tutorialIndex, file, targetClass));
} else {
dispatch(
......@@ -222,9 +220,7 @@ const Tutorial = () => {
})
);
}
} else if (itemPracticeReferenceData == "upload") {
console.log(uploadImage);
} else if (itemPracticeReferenceData == "upload") {
const curriculumIndex: number = 1;
const tutorialIndex: number = 1;
const imageData: any = uploadImage[0]; // Your image data
......
......@@ -421,9 +421,7 @@ const List = () => {
dispatch(fetchTutorials());
}, [dispatch]);
useEffect(() => {
console.log(tutorials);
useEffect(() => {
setData(tutorials);
}, [tutorials])
......
......@@ -89,8 +89,7 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
initialValues: getInitialValues(curriculum!),
validationSchema: CurriculumSchema,
enableReinitialize: true,
onSubmit: (values, { setSubmitting, resetForm }) => {
console.log(values);
onSubmit: (values, { setSubmitting, resetForm }) => {
try {
if (curriculum) {
......
......@@ -30,9 +30,7 @@ const slice = createSlice({
},
// HAS ERROR
hasError(state, action) {
console.log(action.payload);
hasError(state, action) {
state.error = action.payload;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment