diff --git a/src/app/admin/students/page.tsx b/src/app/admin/students/page.tsx index 579f2c1..b68e6dc 100644 --- a/src/app/admin/students/page.tsx +++ b/src/app/admin/students/page.tsx @@ -35,12 +35,9 @@ export default function StudentsPage() { try { const formData = new FormData() 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", body: formData, - headers: { - "Authorization": `Bearer ${localStorage.getItem("active_session_token")}` - } }) if (!rawRes.ok) throw new Error("Upload failed")