Update API endpoints and navigation paths in admin templates

This commit is contained in:
2025-05-18 14:28:02 +03:30
parent 5e8fd13ea4
commit e97b9bdb0c
2 changed files with 3 additions and 3 deletions

View File

@@ -98,7 +98,7 @@ async function sendAction(action) {
if (!currentMedia?.id) return;
const token = getToken();
const endpoint = `admin/api/${action}`;
const endpoint = `api/${action}`;
await fetch(endpoint, {
method: 'POST',
headers: {
@@ -130,7 +130,7 @@ function showMessage(text) {
}
async function fetchMedia(token) {
const res = await fetch('admin/api/getmedia', {
const res = await fetch('api/getmedia', {
method: 'GET',
headers: { 'Authorization': 'Bearer ' + token }
});

View File

@@ -70,7 +70,7 @@ function login() {
document.getElementById('message').innerText = data.message;
saveToken(data.token);
setTimeout(() => {
window.location.href = "index.html";
window.location.href = "/";
}, 1000);
} else {
document.getElementById('message').innerText = "Login failed.";