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])
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(
......@@ -223,8 +221,6 @@ const Tutorial = () => {
);
}
} else if (itemPracticeReferenceData == "upload") {
console.log(uploadImage);
const curriculumIndex: number = 1;
const tutorialIndex: number = 1;
const imageData: any = uploadImage[0]; // Your image data
......
......@@ -422,8 +422,6 @@ const List = () => {
}, [dispatch]);
useEffect(() => {
console.log(tutorials);
setData(tutorials);
}, [tutorials])
......
......@@ -90,7 +90,6 @@ const AddEditCurriculum = ({ curriculum, onCancel }: Props) => {
validationSchema: CurriculumSchema,
enableReinitialize: true,
onSubmit: (values, { setSubmitting, resetForm }) => {
console.log(values);
try {
if (curriculum) {
......
......@@ -31,8 +31,6 @@ const slice = createSlice({
// HAS ERROR
hasError(state, action) {
console.log(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