fix: correct API paths in habits.html to use /echo/api prefix
This commit is contained in:
@@ -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' }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user