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 }) => { ...@@ -67,8 +67,6 @@ export const JWTProvider = ({ children }: { children: React.ReactElement }) => {
const response = await axiosServices.get('/rest_node/user/current-user'); const response = await axiosServices.get('/rest_node/user/current-user');
const { user } = response.data; const { user } = response.data;
console.log(user);
dispatch({ dispatch({
type: LOGIN, type: LOGIN,
payload: { payload: {
......
// material-ui // material-ui
import useAuth from "hooks/useAuth";
import { useEffect } from "react";
// project import // project import
// ==============================|| Dashboard ||============================== // // ==============================|| Dashboard ||============================== //
const 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])
return ( return (
<> <>
......
...@@ -205,8 +205,6 @@ const Tutorial = () => { ...@@ -205,8 +205,6 @@ const Tutorial = () => {
const file = new File([blob], 'image.jpg', { type: 'image/jpeg' }); const file = new File([blob], 'image.jpg', { type: 'image/jpeg' });
console.log(file);
dispatch(CalculateMarks(curriculumIndex, tutorialIndex, file, targetClass)); dispatch(CalculateMarks(curriculumIndex, tutorialIndex, file, targetClass));
} else { } else {
dispatch( dispatch(
...@@ -222,9 +220,7 @@ const Tutorial = () => { ...@@ -222,9 +220,7 @@ const Tutorial = () => {
}) })
); );
} }
} else if (itemPracticeReferenceData == "upload") { } else if (itemPracticeReferenceData == "upload") {
console.log(uploadImage);
const curriculumIndex: number = 1; const curriculumIndex: number = 1;
const tutorialIndex: number = 1; const tutorialIndex: number = 1;
const imageData: any = uploadImage[0]; // Your image data const imageData: any = uploadImage[0]; // Your image data
......
...@@ -421,9 +421,7 @@ const List = () => { ...@@ -421,9 +421,7 @@ const List = () => {
dispatch(fetchTutorials()); dispatch(fetchTutorials());
}, [dispatch]); }, [dispatch]);
useEffect(() => { useEffect(() => {
console.log(tutorials);
setData(tutorials); setData(tutorials);
}, [tutorials]) }, [tutorials])
......
...@@ -89,8 +89,7 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => { ...@@ -89,8 +89,7 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
initialValues: getInitialValues(curriculum!), initialValues: getInitialValues(curriculum!),
validationSchema: CurriculumSchema, validationSchema: CurriculumSchema,
enableReinitialize: true, enableReinitialize: true,
onSubmit: (values, { setSubmitting, resetForm }) => { onSubmit: (values, { setSubmitting, resetForm }) => {
console.log(values);
try { try {
if (curriculum) { if (curriculum) {
......
...@@ -30,9 +30,7 @@ const slice = createSlice({ ...@@ -30,9 +30,7 @@ const slice = createSlice({
}, },
// HAS ERROR // HAS ERROR
hasError(state, action) { hasError(state, action) {
console.log(action.payload);
state.error = action.payload; 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