fix(frontend): use relative URLs to support reverse proxy subpath (/sync/)
This commit is contained in:
1 parent
b36445d203
commit
c098376aa4
2 files changed
+6
-6
No files matched your search
+4
-4
@@ -19,7 +19,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
if (!url) return;
|
||||
|
||||
try {
|
||||
const res = await fetch("/api/download", {
|
||||
const res = await fetch("api/download", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ url })
|
||||
@@ -40,7 +40,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
syncLikesBtn.addEventListener("click", async () => {
|
||||
if (!confirm("Запустить синхронизацию плейлиста «Мне нравится» из Яндекс Музыки?")) return;
|
||||
try {
|
||||
const res = await fetch("/api/sync/yandex-likes", { method: "POST" });
|
||||
const res = await fetch("api/sync/yandex-likes", { method: "POST" });
|
||||
const data = await res.json();
|
||||
if (data.task_id) {
|
||||
fetchTasks();
|
||||
@@ -52,7 +52,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
async function fetchTasks() {
|
||||
try {
|
||||
const res = await fetch("/api/tasks");
|
||||
const res = await fetch("api/tasks");
|
||||
const tasks = await res.json();
|
||||
renderTasks(tasks);
|
||||
} catch (err) {
|
||||
@@ -87,7 +87,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
async function fetchHistory() {
|
||||
try {
|
||||
const res = await fetch("/api/history");
|
||||
const res = await fetch("api/history");
|
||||
const data = await res.json();
|
||||
if (tracksCount) tracksCount.textContent = `Загружено: ${data.total || 0}`;
|
||||
renderHistory(data.tracks || []);
|
||||
|
||||
Reference in new issue
Block a user