Update frontend/src/components/AdminPanel.jsx
Browse files
frontend/src/components/AdminPanel.jsx
CHANGED
@@ -20,7 +20,7 @@ function AdminPanel({ isCollapsed, onToggleCollapse, userName, onLogout,setPage
|
|
20 |
const fetchDocuments = async () => {
|
21 |
setIsLoading(true);
|
22 |
try {
|
23 |
-
const response = await fetch('
|
24 |
credentials: 'include'
|
25 |
});
|
26 |
|
@@ -66,7 +66,7 @@ function AdminPanel({ isCollapsed, onToggleCollapse, userName, onLogout,setPage
|
|
66 |
formData.append('tags', uploadData.tags);
|
67 |
|
68 |
try {
|
69 |
-
const response = await fetch('
|
70 |
method: 'POST',
|
71 |
credentials: 'include',
|
72 |
body: formData
|
@@ -93,7 +93,7 @@ function AdminPanel({ isCollapsed, onToggleCollapse, userName, onLogout,setPage
|
|
93 |
}
|
94 |
|
95 |
try {
|
96 |
-
const response = await fetch(
|
97 |
method: 'DELETE',
|
98 |
credentials: 'include'
|
99 |
});
|
|
|
20 |
const fetchDocuments = async () => {
|
21 |
setIsLoading(true);
|
22 |
try {
|
23 |
+
const response = await fetch('/api/admin/knowledge', {
|
24 |
credentials: 'include'
|
25 |
});
|
26 |
|
|
|
66 |
formData.append('tags', uploadData.tags);
|
67 |
|
68 |
try {
|
69 |
+
const response = await fetch('/api/admin/knowledge/upload', {
|
70 |
method: 'POST',
|
71 |
credentials: 'include',
|
72 |
body: formData
|
|
|
93 |
}
|
94 |
|
95 |
try {
|
96 |
+
const response = await fetch(`/api/admin/knowledge/${docId}`, {
|
97 |
method: 'DELETE',
|
98 |
credentials: 'include'
|
99 |
});
|