fix: Admin students Bulk CSV fetch url

This commit is contained in:
2026-09-24 21:01:48 +05:30
parent c290fb689b
commit 5ebd01c97e

View File

@@ -35,12 +35,9 @@ export default function StudentsPage() {
try { try {
const formData = new FormData() const formData = new FormData()
formData.append("file", file) formData.append("file", file)
const rawRes = await fetch(process.env.NEXT_PUBLIC_API_URL ? `${process.env.NEXT_PUBLIC_API_URL}/api/admin/students/bulk` : "http://localhost:8000/api/admin/students/bulk", { const rawRes = await fetchWithAuth("/api/admin/students/bulk", {
method: "POST", method: "POST",
body: formData, body: formData,
headers: {
"Authorization": `Bearer ${localStorage.getItem("active_session_token")}`
}
}) })
if (!rawRes.ok) throw new Error("Upload failed") if (!rawRes.ok) throw new Error("Upload failed")