change get peers endpoint

This commit is contained in:
afazio1
2024-04-22 10:32:38 -04:00
parent d0c43ee6fe
commit 2bcbf73ea3
3 changed files with 10 additions and 18 deletions

View File

@@ -17,7 +17,9 @@ export default function RegisterFile() {
})
.then(response => response.json())
.then(data => {
const files: string[] = data.files
const files: string[] = data.files.map((file: string) => {
return file.replace(/\s/g, "_");
})
setRegisteredFiles(
serverFiles.map((file) => {
if (files.includes(file.filename)) {
@@ -32,12 +34,12 @@ export default function RegisterFile() {
}, [serverFiles])
const fetchServerFiles = () => {
fetch(`http://localhost:8000/api/files/filter?peer_id=1`, {
fetch(`http://localhost:8000/api/get-peer-files/`, {
method: 'GET',
headers: getAuthHeaders()
})
.then(response => response.json())
.then(data => {
.then(data => {
setServerFiles(data)
})
.catch(error => console.error(error));

View File

@@ -28,7 +28,7 @@ nav div {
align-items: center;
justify-content: center; /* If you're centering the content */
height: 100vh; /* Full height */
margin-top: -100px; /* Move up */
margin-top: 100px; /* Move up */
width: 100%;
}