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