diff --git a/src/context/AuthContext.tsx b/src/context/AuthContext.tsx index 5fc0ce8..331d456 100644 --- a/src/context/AuthContext.tsx +++ b/src/context/AuthContext.tsx @@ -239,7 +239,7 @@ export function AuthProvider({ children }: { children: ReactNode }) { // Direct local check for Admin credentials fallback if ( - (cleanedUser.equalsIgnoreCase?.('Transport') || cleanedUser.toLowerCase() === 'transport') && + cleanedUser.toLowerCase() === 'transport' && cleanedPass === 'RIT@2026' ) { const role = 'ROLE_TRANSPORT'; diff --git a/src/pages/Admin/AdminDashboard.tsx b/src/pages/Admin/AdminDashboard.tsx index 212b9ac..aca998c 100644 --- a/src/pages/Admin/AdminDashboard.tsx +++ b/src/pages/Admin/AdminDashboard.tsx @@ -72,8 +72,10 @@ interface QuestionItem { body: string; authorName: string; authorEmail: string; - tags: string[]; - votes: number; + tags?: string[]; + votes?: number; + createdAt?: string; + status?: string; } export default function AdminDashboard() { @@ -209,9 +211,7 @@ export default function AdminDashboard() { if (!isLoggedIn) return; if (activeTab === 'transport') fetchRoutes(); if (activeTab === 'telegram') fetchTelegramConfig(); - if (activeTab === 'notes') fetchNotes(); if (activeTab === 'community') fetchQuestions(); - if (activeTab === 'subscribers') fetchRecipients(); if (activeTab === 'faculty') fetchFaculty(); if (activeTab === 'clubs') fetchClubs(); if (activeTab === 'curriculum') fetchCurriculum(); @@ -611,8 +611,8 @@ export default function AdminDashboard() { .catch(() => { if (!saved) { const initialQuestions: QuestionItem[] = [ - { id: 1, title: "When is the fresher's orientation?", content: "I couldn't find the exact date for the CSE orientation.", authorName: "Karthik", authorEmail: "karthik.2024@ritchennai.edu.in", createdAt: new Date().toISOString(), status: "PENDING", tags: ["orientation"], votes: 0 }, - { id: 2, title: "Are laptops mandatory in first year?", content: "Just wondering if we need to bring laptops to college every day.", authorName: "Sneha", authorEmail: "sneha.2024@ritchennai.edu.in", createdAt: new Date(Date.now() - 86400000).toISOString(), status: "APPROVED", tags: ["academics"], votes: 5 } + { id: 1, title: "When is the fresher's orientation?", body: "I couldn't find the exact date for the CSE orientation.", authorName: "Karthik", authorEmail: "karthik.2024@ritchennai.edu.in", createdAt: new Date().toISOString(), status: "PENDING", tags: ["orientation"], votes: 0 }, + { id: 2, title: "Are laptops mandatory in first year?", body: "Just wondering if we need to bring laptops to college every day.", authorName: "Sneha", authorEmail: "sneha.2024@ritchennai.edu.in", createdAt: new Date(Date.now() - 86400000).toISOString(), status: "APPROVED", tags: ["academics"], votes: 5 } ]; setQuestions(initialQuestions); localStorage.setItem(QUESTIONS_STORAGE_KEY, JSON.stringify(initialQuestions)); @@ -1391,76 +1391,7 @@ export default function AdminDashboard() { )} - {/* ───────────────────────────────────────────────────────────── */} - {/* TAB 3: NOTES & STUDY MATERIALS */} - {/* ───────────────────────────────────────────────────────────── */} - {activeTab === 'notes' && ( -
View and remove student-accessible notes and previous year question papers.
-- {note.subject} • {note.department} (Sem {note.semester}) -
-