Update API endpoints and navigation paths in admin templates
This commit is contained in:
		@@ -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 }
 | 
			
		||||
    });
 | 
			
		||||
 
 | 
			
		||||
@@ -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.";
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user