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