diff --git a/src/Pages/Admin/Allmembers.jsx b/src/Pages/Admin/Allmembers.jsx index 34420a1..48dc90e 100644 --- a/src/Pages/Admin/Allmembers.jsx +++ b/src/Pages/Admin/Allmembers.jsx @@ -22,7 +22,7 @@ const Allmembers = () => { try { const response = await fetch( - "http://192.168.169.77:8000/membershipform/", + "http://192.168.12.72:8000/membershipform/", { headers: { Authorization: token, diff --git a/src/Pages/Admin/Analysis.jsx b/src/Pages/Admin/Analysis.jsx index 5b3383c..54176aa 100644 --- a/src/Pages/Admin/Analysis.jsx +++ b/src/Pages/Admin/Analysis.jsx @@ -33,7 +33,7 @@ const Dashboard = () => { useEffect(() => { axios - .get("http://192.168.169.77:8000/membershipform/") + .get("http://192.168.12.72:8000/membershipform/") .then((response) => { console.log("API response:", response.data); // Debugging log setFormData(response.data); diff --git a/src/Pages/Admin/Approvalpage.jsx b/src/Pages/Admin/Approvalpage.jsx index 20c6051..eb8f245 100644 --- a/src/Pages/Admin/Approvalpage.jsx +++ b/src/Pages/Admin/Approvalpage.jsx @@ -14,7 +14,7 @@ const ApprovalPage = () => { setLoading(true); try { const token = localStorage.getItem("token"); - const response = await axios.get("http://192.168.169.77:8000/approval/", { + const response = await axios.get("http://192.168.12.72:8000/approval/", { headers: { Authorization: `Token ${token}`, }, @@ -24,6 +24,8 @@ const ApprovalPage = () => { setPendingApplications(response.data.pending); setRejectedApplications(response.data.rejected); setApprovedApplications(response.data.approved); + + console.log("Rejected Applications:", response.data.rejected); // Add this line to verify rejected applications } catch (error) { console.error("Error fetching data:", error); setError(error.message); @@ -40,7 +42,7 @@ const ApprovalPage = () => { try { const token = localStorage.getItem("token"); await axios.post( - "http://192.168.169.77:8000/approval/", + "http://192.168.12.72:8000/approval/", { fid, status: "accepted" }, { headers: { @@ -60,7 +62,7 @@ const ApprovalPage = () => { try { const token = localStorage.getItem("token"); await axios.post( - "http://192.168.169.77:8000/approval/", + "http://192.168.12.72:8000/approval/", { fid, reason }, { headers: { diff --git a/src/Pages/Admin/Home.jsx b/src/Pages/Admin/Home.jsx index 22dc41b..09b8782 100644 --- a/src/Pages/Admin/Home.jsx +++ b/src/Pages/Admin/Home.jsx @@ -1,10 +1,18 @@ -import React from "react"; +import React, { useEffect } from "react"; import { useNavigate } from "react-router-dom"; import "../../index.css"; import Navbar from "./Navbar"; + function Home() { const navigate = useNavigate(); + useEffect(() => { + const token = localStorage.getItem("token"); // Adjust the key name as necessary + if (!token) { + navigate("/adminlogin"); + } + }, [navigate]); + const handleMembership = () => { navigate("/membership"); }; @@ -12,14 +20,14 @@ function Home() { return (