fix: correct API paths in habits.html to use /echo/api prefix

This commit is contained in:
Echo
2026-02-10 14:04:42 +00:00
parent d36685c66b
commit bae6c9da3c

View File

@@ -705,7 +705,7 @@
createBtn.textContent = 'Se creează...';
try {
const response = await fetch('/api/habits', {
const response = await fetch('/echo/api/habits', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name, frequency })
@@ -760,7 +760,7 @@
habitsList.style.display = 'none';
try {
const response = await fetch('/api/habits');
const response = await fetch('/echo/api/habits');
if (!response.ok) {
throw new Error('Failed to fetch habits');
@@ -866,7 +866,7 @@
const originalStreak = streakElement ? streakElement.textContent : '0';
try {
const response = await fetch(`/api/habits/${habitId}/check`, {
const response = await fetch(`/echo/api/habits/${habitId}/check`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' }
});
@@ -941,7 +941,7 @@
deleteBtn.textContent = 'Se șterge...';
try {
const response = await fetch(`/api/habits/${habitToDelete}`, {
const response = await fetch(`/echo/api/habits/${habitToDelete}`, {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' }
});