fix: Admin students Bulk CSV fetch url
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user